Problem solve Get help with specific problems with your technologies, process and projects.

How to retrieve SQL Server database disk space in use

Find out where to look for the current amount of SQL Server database disk space being used in your environment.

I am trying to retrieve the current amount of disk space being used by our SQL Server databases. I'd like to enter the results into a table where I can use the fields to populate a report. How can I find this information?
The current size of the data files can be found within the SQL Server. You can use the sysaltfiles table (system view in SQL Server 2005 and up) to see how large each file is.

SELECT name, filename, (size*8)/1024
FROM sysaltfiles.

This was last published in March 2008

Dig Deeper on Microsoft SQL Server 2005

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.