SQL SERVER – 2005 – Get a row per file of a database as stored in the master database

Each database have minimum of two files associated with database. If database has more than one filegroup it will have many files associated with one database. Following quick script will give you recordset per file of a database which are stored in master database.
SELECT name, physical_name, type_desc, state_desc
FROM sys.master_files

Above script will return following result set.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

2 thoughts on “SQL SERVER – 2005 – Get a row per file of a database as stored in the master database

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