PRINT '存在'
ELSE
PRINT '不存在'
1.数据库if exists(select 1 from master..dbo.sysdatabases where name='example')
print 'DataBase existed'
else
print 'Database not existed'
2.表
IF Exists(Select 1 From sysObjects Where Name ='表名' And Type In ('S','U'))
Print 'Exists Table'
Else
Print 'Not Exists Table'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)