Select *, fileproperty(name, ‘SpaceUsed’) as Used From dbo.sysfiles;

SELECT name ,size/128.0 – CAST(FILEPROPERTY(name, ‘SpaceUsed’) AS int)/128.0 AS AvailableSpaceInMB FROM sys.database_files;

select d.name, m.name, m.physical_name from sys.master_files m

inner join sys.databases d on (m.database_id = d.database_id) order by 1, 2;