MSSQL에서 DB의 목록을 보려면 아래와 같이 실행하면 된다.
※ 참고사이트 : http://blog.sqlauthority.com/2007/05/12/sql-server-2005-list-all-the-database/
----SQL SERVER 2005 System Procedures
EXEC sp_databases
EXEC sp_helpdb
----SQL 2000 Method still works in SQL Server 2005(On/Offline 모두출력)
SELECT name FROM sys.databases
SELECT name FROM sys.sysdatabases
----SQL SERVER Un-Documented Procedure
EXEC sp_msForEachDB 'PRINT ''?'''
EXEC sp_databases
EXEC sp_helpdb
----SQL 2000 Method still works in SQL Server 2005(On/Offline 모두출력)
SELECT name FROM sys.databases
SELECT name FROM sys.sysdatabases
----SQL SERVER Un-Documented Procedure
EXEC sp_msForEachDB 'PRINT ''?'''
※ 참고사이트 : http://blog.sqlauthority.com/2007/05/12/sql-server-2005-list-all-the-database/