Search

Monday, September 30, 2013

Query to get All Databases Size

User below query to find Database Size :

SELECT  d.name AS [Database Name],
        ROUND(SUM(mf.size) * 8 / 1024, 0) [Size (MB)]
FROM    sys.master_files mf
        INNER JOIN sys.databases d ON d.database_id = mf.database_id
WHERE   d.database_id > 4 
GROUP BY d.name 
ORDER BY d.name

3 comments:

  1. Do you mind if I quote a few of your articles as long as I provide credit and sources back to your website?
    My website is in the very same area of interest as yours and my
    users would truly benefit from some of the information you present here.
    Please let me know if this alright with you. Cheers!


    Visit my blog post: stairlifts

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. I don't mind. You can post some of my articles.

      Delete