Caveman's Blog

My commitment to learning.

Archive for November 6th, 2009

Sql Server: How to list all the database names

Posted by cavemansblog on November 6, 2009

There are two ways of listing the available database names in SQL Server, using T-SQL


select name from master..sysdatabases

EXEC sp_msForEachDB 'PRINT ''?''';

Posted in Sql Server | Tagged: , | Leave a Comment »