What's the difference from the sys.master_files and sys.database_files? I've about 20 databases during my instance however when I query the sys.master_files I don't get any rows. Why? After I query sys.database_files I recieve the data concerning the database files in regards to the current database.
Consists of a row per file of the database as saved within the master database. This is really a single, system-wide view.
Consists of a row per file of the database as saved within the database itself. This can be a per-database view.
SELECT * FROM sys.master_files should list the files for every database within the instance whereas
SELECT * FROM sys.database_files should list the files for that specific database context.
Testing this here (SQL 2K8), it really works according to the above mentioned?
Update: If you are not seeing rows from sys.master_files, maybe it's a permissions problem as BOL states:
The minimum permissions which are needed to determine the related row are CREATE DATABASE, ALTER ANY DATABASE, or VIEW ANY DEFINITION.
Whereas for sys.database_files just requires membership within the public role.