if(exists( select * from sys.databases where name='数据库名')) begin print '存在' end else begin print '不存在' end