如何判断SQL-Server中某个数据库是否存在?急!!!(加分) if exists(select 1 from master..sysdatabases where name='你要检测的数据库名') print '在'else print '没有' 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 use masterdeclare @i intselect @i=count(*) from sysdatabases where name='你的数据库名'if @i=0 beginprint '数据库不存在'endelseprint '数据库存在' 如何获取某一周的第一天和最后一天的日期 SQL SELECT INTO语句如何创建并复制一个或多个表到别一个数据库 sql merge 中的output怎么用? sql汇总问题 表锁定的问题 看看这个SQL语句该怎么写 急。。。sqlserver2000生成sql脚本的时候已经选择了(全部默认值),但是生成的脚本中没有默认值的说明。。 把表的内容导到EXCEL里面的问题 触发器显示不能使用? 急急!!SQLSERVER2000存储过程错误,请各位帮忙谢谢。(内有详细情况) 高手请进 求一sql语句
declare @i int
select @i=count(*) from sysdatabases where name='你的数据库名'
if @i=0 beginprint '数据库不存在'
end
else
print '数据库存在'