"Well, the last isue would be a select *, but then you run the chance of getting all the data dumped."
or "select * from tablename where 1=0" so no data is dumped and empty table results or an error (which you handle) Stephen Crabb -----Original Message----- From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of Thomas Tomiczek Sent: 25 April 2002 06:57 To: [EMAIL PROTECTED] Subject: Re: [DOTNET] Checking Existance and Creating SqlServer Objects Yes, there is - you can even do it in the create SQL Statement. At least with SQL Server 2000. Otherwise not really. Well, the last isue would be a select *, but then you run the chance of getting all the data dumped. SQL Actually defines schema views that awould allow you to query for objects, BUT - if you are not for a specific dtabase (or set thereof) I think not all databases support the schema views yet. Regards Thomas Tomiczek THONA Consulting Ltd. (Microsoft MVP C#/.NET) -----Original Message----- From: Jeff Block [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 24. April 2002 23:11 To: [EMAIL PROTECTED] Subject: [DOTNET] Checking Existance and Creating SqlServer Objects 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 You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.