How to list all Databases in MSSQL

To list all Databases in MSSQL you can use the following snippet.

Sample MSSQL

SELECT name FROM sys.databases

SQL Server Version newer than MS SQL 2000 also support these StoredProcedures.

EXEC sp_databases

or

EXEC sp_helpdb

Please Share us:
Please rate this snippet

2 thoughts on “How to list all Databases in MSSQL

Leave a Reply