Data File space | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Data File space

Is there a script or procedure that can be run to return the free / unused space in a data file? (This data file also includes a text column) The proc sp_helpdb tells me the size of the data file, but not the free space.
The proc sp_spaceused is per object, not data file.
If you run sp_spaceused with no object parameter, it returns the space usage for the entire database. Use dbcc showfilestats for a per-file picture. Output is in Extents (64K) so you need to do some sums with this to marry it up to the output from sp_spaceused. Tom Pullen
DBA, Oxfam GB
]]>