Hello,I need to get the following data from a database:1 - Data Size;2 - Log Size;3 - Total Filestream Size;And if possible the free size in (1), (2) and (3).I tried the following:SELECT DB_NAME(DB_ID()) AS DatabaseName, name AS [FileName], size/128.0 AS Size, size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSizeFROM sys.database_files;
This returns the following:DatabaseName FileName Size FreeSizeTestDB TestDB_Data 40.000000 36.937500TestDB TestDB_Log 4.000000 3.593750TestDB TestDB_Filestream 231.468750 228.406250The problem is that I get the data by file.While I would like to simply get 6 variables:DataSize = 40.000000LogSize = 4.000000FilestreamSize = 231.468750DataFreeSize = 36.937500LogFreeSize = 3.593750FilestreamFreeSize = 228.406250Thank You,Miguel