Technique 1:
EXEC sp_helpdb
EXEC sp_helpdb

Technique 2: For a specific database:
sp_helpdb
'adventureworks'
And you get the following output: (this one gives you the database and data file information for a specific database)
![]()
EXEC sp_spaceused
This is what you get:

SELECTDB_NAME(database_id)
AS
DatabaseName,
Name
AS
LogicalName,
size
*8/1024 Size_in_MB,
max_size
FROM sys.master_files
WHEREDB_NAME(database_id)=
'AdventureWorks'
GO

If you liked this post, do like us on FaceBook at http://www.facebook.com/pages/BI-Architects/249973345047634?sk=wall