请问sql server里面有没有函数判断某个数据库是否存在? if not exists (select * from master..sysdatabases where name = 'Tempdb') create ... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 use mastergoselect name from sysdatabases if db_id('库名') is null if db_id('库名') is null print '在'else print '不在' select case when db_id('数据库名') is not null then '在' else '不在' end if not exists (select * from master..sysdatabases where name = '库名')print '不在'elseprint '在' 我想在项目中添加权限,但是不知道在数据库表怎么设计? 如何优化存储过程 请教一个增加树形表记录的存储过程 如何将ORACLE导出的数据库导入SQL foreign key问题 關于數據備份恢復的問題100 字段自动增加值的问题 求sql语句 买图书馆管理系统源代码 【求大神指点】SQL Server 如果有N多个用户同时访问数据库问题? 查询中写的where条件如何取消自动变成join。 请教字符串处理问题
go
select name from sysdatabases
print '在'
else
print '不在'
select case when db_id('数据库名') is not null then '在'
else '不在'
end
print '不在'
else
print '在'