Sql database size

This article is tagged with: Sql database size and mysql

sql database size

SELECT
d.name AS 'Database',
m.name AS 'File',
m.size,
m.size * 8/1024 'Size (MB)',
SUM(m.size * 8/1024) OVER (PARTITION BY d.name) AS 'Database Total',
m.max_size
FROM sys.master_files m
INNER JOIN sys.databases d ON
d.database_id = m.database_id;

sql database size

USE <database_name>;
EXEC sp_spaceused;</database_name>

sql database size

EXEC sp_databases;

This article is tagged with: Sql database size and mysql