sys.master_files :
Contains a string on the database file as stored in the main database. This is a single system-wide view.
sys.database_files :
Contains a string in the database file stored in the database itself. This is a view for each database.
So, SELECT * FROM sys.master_files should display files for each database in an instance, while SELECT * FROM sys.database_files should display files for a specific database context.
Testing here (SQL 2K8), does it work as above?
Update: If you do not see the lines from sys.master_files, this may be a permission issue, since the state is BOL:
The minimum permissions required to see the corresponding row are CREATE DATABASE, ALTER ANY DATABASES, or VIEW ANY DEFINITION.
While sys.database_files just requires membership in a public role.
Adathedev
source share