Deny Permissions On Multiple Roles in SQL

Below is the correct syntax to deny permissions on a role in a SQL Server database. How do you deny permissions to several roles.. Lets say the role names are: Role1, Role2 and Role 3
use Testdb;
DENY SELECT on database:: testdb
to Role1;
go

Open in new window

LVL 1
cheryl9063Asked:
Who is Participating?
 
cyberkiwiCommented:
I apologize, please use the following:

DENY SELECT on database:: testdb to Role1, Role2, Role3;

I was reading a different section of BOL
0
 
cyberkiwiCommented:
You have to fire multiple queries to do that, i.e.

DENY SELECT on database:: testdb to Role1;
DENY SELECT on database:: testdb to Role2;

etc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.