Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

revoke statement

Status
Not open for further replies.
Mar 29, 2004
120
US
I have a db_owner sql account that I want to revoke create permissions from.

I log in as dbo (sysadmin) and execute:


REVOKE
CREATE DEFAULT,
CREATE FUNCTION,
CREATE PROCEDURE,
CREATE RULE,
CREATE TABLE,
CREATE VIEW,
BACKUP DATABASE,
BACKUP LOG

from test_me

But I can still create table, procedures and everything else.

What gives?

Thanx
 
Firstly, REVOKE only removes any explicitly defined GRANTED or DENIED permissions from that user. You need to use DENY if you explicitly want to deny the permissions.

In this case, if you use REVOKE the user will still be able to execute those statements as they are a member of the db_owner role.

Having said that, I know with sysadmin members that it is impossible to deny permissions from them - the sa membership overrides any other permissions checking. I don't know whether the same thing applies at a database level with db_owner members - try it and see.

As a further point, if you don't want the user to be able to execute all those statement why not just remove them from the db_owner role and simply grant them the permissions for the things you DO want them to be able to do? That would make much more logical sense and would make administration much easier.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top