SELECT db.NAME AS DBName ,TYPE_DESC AS FileType ,PHYSICAL_NAME AS Location ,CAST((mf.size * 8) / 1024 AS VARCHAR(26)) + ' MB' AS FileSize FROM sys.master_files mf INNER JOIN sys.databases db ON db.DATABASE_ID = mf.DATABASE_ID WHERE db.NAME LIKE 'QA%'
Filter databases by name
SELECT db.NAME AS DBName FROM sys.databases db WHERE db.NAME LIKE 'QA%'
Check SQL Server database and log file size with the stored procedure sp_SDS written by Richard Ding.
Usage:
sp_spaceused 'objname' sp_helpdb 'objname' sp_SDS 'objname'