Pages

Wednesday, November 9, 2011

SQL Database information


Here I will discuss how to get the information of space occupied, location of data file and log file of all the database in one go.
Step 1: Change the execute mode to Text and 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

SQL DataBase Information

Step 2: Now execute the output of the query in step 1 and information of all the datbase will appear in result section.
The output will be

SQL DataBase Information

No comments:

Post a Comment