--判断数据库是否存在

if exists(select 1 from sys.databases where name='dbName')

  --存在

--判断数据表是否存在

if exists(select * from sys.objects where name ='tbName' )
  --存在

posted on 2012-12-04 12:09  夏末丶拾忆  阅读(106)  评论(0编辑  收藏  举报