Total Pageviews

Search This Blog

Friday, July 8, 2011

Tip - List all databases on the server EXEC sp_helpdb

Doing a quickie here...

I had a need to extract all the databases into an excel to report on them. Here's a cool SQL which came handy for me:

Open SSMS (SQL Server Mgmt Studio) and fire this sql in the query window:

EXEC sp_helpdb
This will list all the databases name, alongwith some other useful info like size, owner when the db was created, db statust etc. Quite handy. Love SQL :-)

No comments: