check if table already exists?? 
Author Message
 check if table already exists??

Try:

if object_id ('MyTable') is null
    print 'Table does not exist'
else
    print 'Table exists'

--
   Tom

----------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql

---
Hello,

How could I check, if a table already exists???

THank you very much

Ciao
Martin



Thu, 14 Apr 2005 21:19:01 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. vb: check if table already exists??

2. How to check if a table already exists

3. Checking if a #temp1 table exists already

4. How to check if an tempory table already exists

5. Check if a file already exists

6. Checking if a Global Variables already exists

7. how to check if a cursor already exists...

8. Check if temp. SP already exists

9. How to check if Temp SP already exist

10. Check if cursor already exists.

11. Temporary Table already exists

12. add new table unless already exists


 
Powered by phpBB® Forum Software