List all Databases and Their Associated Files

30 09 2014

Sometimes we need a clear picture for a project or perhaps we have just taken over a new server to administer. We need to know certain things like what the heck is going on with all of these databases and why is the disk full?

select d.name, d.recovery_model_desc , d.is_encrypted, mf.name, mf.physical_name, ((mf.size * 8) / 1024) as 'File Size (MB)', mf.type_desc as 'type' FROM sys.databases d
Inner join sys.master_files mf on d.database_id = mf.database_id

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: