在新建数据库的时候判断要建的数据库是否存在

2014-11-24 07:55:26 · 作者: · 浏览: 8

在新建 数据库的时候判断要建的
数据库
是否存在
if(exists( select * from sys.databases where name='数据库名'))
begin www.2cto.com
print '存在'
end
else
begin
print '不存在'
end