Take the 2-minute tour ×  How do I determine if a table exists
in a SQL Server database in SQL Server 2008?  share|improve this
question add comment  2 Answers  up vote 12 down vote accepted
If you query the sysobjects table, with a query like  SELECT *
FROM sysobjects WHERE xtype = 'U' AND name = 'yourTableName'
xtype = 'U' is a user table  you can then wrap this is an IF
EXISTS statement  IF EXISTS (SELECT * FROM sysobjects ...)     '
do your stuff here if it exists share|improve this answer +1 It
is important to note that Microsoft has been moving
functionality like this to Dynamic Management Views (DMVs) since
SQL Server 2005. This will technically work, but Microsoft now
recommends using the sys.tables DMV for this. IF EXISTS(SELECT *
FROM sys.tables WHERE type = 'U' AND name = 'yourTableName').
Functionally, your statement and my statement do the exact same
thing. Just wanted to mention DMVs. To learn more about DMVs,
check out the documentation msdn.microsoft.com/en-
US/library/ms188754%28v=SQL.105%29