Categories
SQL Server

Checking if a table exists in your SQL Server 2000 database

So you want to check, before you declare, or do anything special, whether a table exists in your database. This is important when you want to update more than one database instance and are writing a script. To do that run the following test:

IF EXISTS (select * from sysobjects where id = object_id(‘[name_of_your_table]’))

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Share