--判断数据库是否存在

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  MJQ1  阅读(113)  评论(0)    收藏  举报