Database Sql server to check or monitor or trace the free space/used/ file size in MB

Database to check or monitor free space available

select convert(decimal(12,2),round((a.size-fileproperty(a.name,'SpaceUsed'))/128.000,2)) as FreeSpaceMB from dbo.sysfiles a where fileid = 1;

Database to check or monitor File size MB

select convert(decimal(12,2),round(a.size/128.000,2)) as FileSizeMB from dbo.sysfiles a where fileid = 1;

Database to check or monitor Space Used size in MB

select convert(decimal(12,2),round(fileproperty(a.name,'SpaceUsed')/128.000,2)) as SpaceUsedMB from dbo.sysfiles a where fileid = 1;
Vikram Chandra Theme by BloggerThemes & NewWPThemes Sponsored by iBlogtoBlog