i need to calculate how much space is remaining to be utilised in my database.One option is to use sp_spaceused and using "unallocated space" and "database_size", i can get DB size availability percentageDBAvlPercent = unallocated space / database_size
Second option is to use sysfiles valueselect Round(CAST(100 * (CAST (((sysfiles.size -CAST(FILEPROPERTY(sysfiles.name,'SpaceUsed' ) AS float))/(sysfiles.size)) AS float)) as float),2) as [DBAvlPercent]
Please let me know which option is correct.I am asking this question because both the formulae give different values