Sunday, 25 February 2018

Check used space of all Database using SQL Query

///////////////
SELECT sys.databases.name, CONVERT(VARCHAR,SUM(size)*8/1024)+' MB' AS [Total disk space] FROM sys.databases  
JOIN sys.master_files ON  sys.databases.database_id=sys.master_files.database_id 
GROUP BY sys.databases.name ORDER BY sys.databases.name 







No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...