sql 判斷表是否存在

if object_id(N'tablename',N'U') is not null
drop table tablename
gotable

if exists (select * from sysobjects where id = object_id(N'[dbo].[tbname]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tbname]
goobject

相關文章
相關標籤/搜索