Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GRANT specific role ALTER access to specific table

I have tried many ways to do this with no success, but what I want to do is the following:

GRANT ALTER ON [dbo].[theTable] TO [role]

Bonus if you can also provide me some permission state before & after eg.

SELECT * 
FROM fn_my_permissions('dbo.theTable', 'TABLE'); 

Many thanks in advance :)

like image 760
Matt Rowles Avatar asked Feb 10 '12 04:02

Matt Rowles


2 Answers

GRANT ALTER ON [dbo].[theTable] TO [role] 
GO
like image 190
user2537968 Avatar answered Sep 29 '22 12:09

user2537968


GRANT ALTER ON object TO principal is the correct form of the statement in your case.

To view the permissions granted to you on the object, use the fn_my_permissions function like this:

SELECT *
FROM sys.fn_my_permissions('object', 'OBJECT')
;
like image 21
Andriy M Avatar answered Sep 29 '22 14:09

Andriy M