Script to Find Free Space in SQL Server Database

Resolved SQL
CM
Community Member
June 29, 2016
2 replies
1,870 views
Reviewed by moderators

Is there any way to find the free space of my database files? I have found some DBCC commands for it but don't know how to use them.

2 Answers
Accepted Answer
Verified by Edwin J. Hoffer, Expert · Reviewed June 2016

you can use sp_spaceusedto see how much free space there is in the database.

You can also take the help of DBCC SQLPERF (logspace) command to check free space for a SQL Server. It helps to give the information of size of transaction log files for each database.