1. 程式人生 > >Sql server中判斷表是否存在

Sql server中判斷表是否存在

IF EXISTS  (SELECT  * FROM dbo.SysObjects WHERE ID = object_id(N'[table1]') AND OBJECTPROPERTY(ID, 'IsTable') = 1)
PRINT 'Exist'
ELSE
PRINT 'Not Exist'