Monday, March 23, 2009

SQL Database information

SQL Server with plenty of databases. Get the space occupied, the location of data and log etc of each database.

Change the execute mode to Text






Execute the below query you will get all the databases name in the result pane

select 'sp_helpdb ' + name + '' + CHAR(10) + 'go' from sysdatabases



The output will be





Copy the above output and execute you will get the details about all the database at one shot.

No comments:

Site Meter