Eric
Eric

Reputation: 11662

syntax to remove permissions previously granted via GRANT EXECUTE?

If I grant execute permissions to a role via

GRANT EXECUTE ON [DBO].[MYPROC] TO MY_ROLE

what's the equivalent syntax to remove them?

Upvotes: 18

Views: 13587

Answers (3)

Marcus King
Marcus King

Reputation: 1677

DENY EXECUTE ON [DBO].[MYPROC] TO MY_ROLE

Upvotes: 1

Godeke
Godeke

Reputation: 16281

DENY EXECUTE ON [DBO].[MYPROC] TO MY_ROLE

or

REVOKE EXECUTE ON [DBO].[MYPROC] TO MY_ROLE

depending on your goal. The first acts as a filter for any granted permissions, the second removes an explict permission.

Upvotes: 14

mathieu
mathieu

Reputation: 31202

REVOKE EXECUTE ON [DBO].[MYPROC] TO MY_ROLE

Upvotes: 23

Related Questions