Search this blog

Tuesday, June 29, 2010

How to List All the Databases from SQL Server

You can use any of the following queries to retrieve list of all databases

SELECT name FROM sys.databases
SELECT name FROM sys.sysdatabases

Or you can use the following system stored procedure

EXEC sp_databases
EXEC sp_helpdb

1 comment:

  1. To learn .net, C#, Java, J2EE, Silverlight, Visual Basic, Asp .net with advanced concepts, you can visit http://advanceddotnettutorial.blogspot.com

    ReplyDelete