How do I determine if a table exists in a SQL Server database in SQL Server 2008?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
If you query the sysobjects table, with a query like
xtype = 'U' is a user table
you can then wrap this is an IF EXISTS statement
Here is one more way of finding it