find out how much space is left in database files

exec sp_spaceused


select name, filename, convert(decimal(12,2),round(a.size/128.000,2))as FileSizeMB, convert(decimal(12,2),round(fileproperty(,’SpaceUsed’)/128.000,2))as SpaceUsedMB, convert(decimal(12,2),round((a.size-fileproperty(,’SpaceUsed’))/128.000,2))as FreeSpaceMB
from dbo.sysfiles a

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.