find out how much space is left in database files

exec sp_spaceused

or

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

Leave a Reply

Your email address will not be published.

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