Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 443
BetaRide Avatar asked Sep 20 '13 08:09

BetaRide


People also ask

How do I grant user permissions in SQL Server?

Right-click a stored procedure and select Properties. In the Stored Procedure Properties -stored_procedure_name dialog box, under select a page, select Permissions. Use this page to add users or roles to the stored procedure and specify the permissions those users or roles have.

How do I give access to a specific database in SQL Server?

Right-click on Logins and select New. Enter the username. To set permissions, double-click the user account and do one of the following: If you are using SQL Authentication, enter the user name.

How do I give a user permission as read only in SQL Server?

Navigate to Security, right-click Logins and select New Login. On the General screen, select a user or users group. On the User Mappings screen, assign all tables related to NetWrix software the db_datareader role (for example NetWrix_FS_Change_Reporter, or NetWrix_Event_Log_Manager etc).


1 Answers

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
like image 122
Marcello Miorelli Avatar answered Nov 03 '22 02:11

Marcello Miorelli