use 数据库名
if exists ( select *
from sysobjects
where name = '表名'
and type = 'U')
print 'you'
else print 'no'
go
if exists ( select * From master.dbo.sysdatabases
where name='sessrverweb')
print '存在'
else print '不存在'
use 数据库名
if exists ( select *
from sysobjects
where name = '表名'
and type = 'U')
print 'you'
else print 'no'
go
if exists ( select * From master.dbo.sysdatabases
where name='sessrverweb')
print '存在'
else print '不存在'
转载于:https://www.cnblogs.com/eduthanks/archive/2009/02/20/1394964.html