34,873
社区成员
发帖
与我相关
我的任务
分享select * from sys.databases
where database_id>4select @@version
select name from master..sysdatabases
where sid!=0x01
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2008 R2 (CTP) - 10.50.1352.12 (Intel X86)
Oct 30 2009 18:22:17
Copyright (c) Microsoft Corporation
Enterprise Evaluation Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)
(1 行受影响)
name
--------------------------------------------------------------------------------------------------------------------------------
test
test123
Northwind
(3 行受影响)--2005
select
*
from
sys.databases
where
name not in('master','model','msdb','tempdb')--2005
select
*
from
sys.databases
where
name not in('master','model','msdb',tempdb')select * from master..sysdatabases
where sid!=0x01Select name from master..sysdatabases where name not in('master','model','msdb','tempdb','northwind','pubs')