>Is there a way to query for the existance of tables and stored procedures >from C#? From VB6 land I was using SQLDMO, but can't seem to figure it >out through interop in C#. I want to be able to create tables, but only >if they don't exist first, stored procedures I would most likely want to >just drop and recreate. Any thoughts would be very appreciated! > >TIA... > >Jeff
Have you tried just using an IF EXISTS query? Something like.... IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[WORKSTATIONS]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) SELECT 1 ELSE SELECT 0 HTH, Bryan _________________________________________________________ New Vision Software "When the going gets weird," Bryan Stafford "the weird turn pro." [EMAIL PROTECTED] Hunter S. Thompson - www.mvps.org/vbvision Fear and Loathing in LasVegas You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.