How to give a user access to sys.master_files in SQL Server?

12,937

for you to run successfully

select * from sys.master_files

the minimal permissions that you need to grant is as follows:

GRANT VIEW ANY DEFINITION TO [texas_user]
GO

I have tested and it works fine on sql 2008 r2

regards
marcelo
Share:
12,937
BetaRide
Author by

BetaRide

Developer, maker, youtuber. Visit my youtube channel: https://www.youtube.com/channel/UCN8wBEouFtaAyIjjIH2LjJQ

Updated on June 25, 2022

Comments

  • BetaRide
    BetaRide about 2 years

    I need to give a database user read access to the sys.master_files table. How can I do that?

    Currently the user has this permissions:

    enter image description here

    Calling SELECT on sys.master_files returns an empty result. I also tested the same query with the sa user which works as expected.

  • Sandr
    Sandr over 10 years
    Small remark. The above code you need to execute with the sa privileges