June 15, 2004 at 11:49 am
Is there a simple way to test for the existance of a table?
June 15, 2004 at 12:27 pm
Here's one way:
IF EXISTS
(SELECT Name
FROM <dbname>..SysObjects
WHERE Name = '<tablename>')
<rest of code>
Replace <dbname> with the name of the database the table should be in.
Replace <tablename> with the name of the table you are checking for.
-SQLBill
June 17, 2004 at 8:15 am
Or use the Information_Schema.Tables view.. (instead of using sql server system tables)
June 18, 2004 at 1:26 am
Or try:
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply