Query database sizes in SQL Server 2008 R2

434705 pts.
Tags:
SQL Server 2008 R2
SQL Server database
SQL Server Query
I'm using SQL Server 2008 R2 that has over 500 databases. What would be the easiest and most efficient way to query databases of all sizes. The output should have the following columns:

  • DatabaseName
  • DataFilesSize
  • LogFilesSize

Thanks for all the help!

Answer Wiki

Thanks. We'll let you know when a new response is added.

Here is a website that has some sample code for you.

http://stackoverflow.com/questions/18014392/select-sql-server-database-size

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Thanks for passing the info along CharlieBrown. Just getting into SQL server more and it a nice starting point. Surprised this was the first reply on an older post.
    53,155 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: