see sizes for ALL databases

  • I am trying to see the sizes of all the databases on a server so I can plan storage size for a new server with SAN storage.  Is there a way to see or to script a query to see the size of each database on a server at one time?

    Thank you.

  • Have a look at sp_databases (http://msdn2.microsoft.com/en-us/library/ms176070.aspx). You might want to check if the database size includes log files or not.

    - James

     

    --
    James Moore
    Red Gate Software Ltd

  • sp_databases gives you the size of the physical files for each db (data + logfiles)

    If you also want to know how much space is actually used inside those files, you can use sp_spaceused.

    To get the usage for all db's, you can use (undocumented, but useful)

    exec sp_msforeachdb 'use ? exec sp_spaceused'

    /Kenneth

  • PERFECT!  Thank you.  I hadn't thought about the log files.    Those will need a drive of their own.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply