x

User privileges as db_datareader, db_datawriter

All,

Can a user with the db_datareader and db_datawriter access drop or or alter a contraint??
more ▼

asked Apr 04, 2011 at 12:55 PM in Default

Katie 1 gravatar image

Katie 1
1.4k 132 163 202

(comments are locked)
10|1200 characters needed characters left

3 answers: sort newest

Take a look at the fixed db roles in books online:

[http://msdn.microsoft.com/en-us/library/ms189612(v=SQL.100).aspx][1]

The roles grant select, insert and delete along with view database, nothing to do with DDL though.

You will need to take a look at maybe granting access on an object level, or maybe the DDL Admin fixed role, although that allows alot more than just constraints.

[1]: http://msdn.microsoft.com/en-us/library/ms189612(v=SQL.100).aspx
more ▼

answered Apr 04, 2011 at 12:58 PM

WilliamD gravatar image

WilliamD
25.9k 17 19 41

(comments are locked)
10|1200 characters needed characters left
Like there are db_denydatareader and db_denydatawriter fixed roles which given to an individual user would override roles inherited from Windows Groups, I'd like to see a db_denyddladmin fixed role, to solve the scenario: "Allow everyone in the Windows group Statistic Creators except user A and user B to create new views, alter table A, table B and table C"
more ▼

answered Apr 05, 2011 at 04:53 AM

Magnus Ahlkvist gravatar image

Magnus Ahlkvist
16.6k 17 20 33

(comments are locked)
10|1200 characters needed characters left
No. If a user has such ability and you're thinking they only have db_datareader and db_datawriter, check to see if they are coming into the database with a Windows group. Also check to see if they have explicit permissions granted that permit them to create tables or alter the schema containing the tables. Use the sp_helprotect stored procedure in SQL Server 2000 or query the sys.database_permissions catalog view in SQL Server 2005/2008/2008R2.
more ▼

answered Apr 04, 2011 at 06:17 PM

K. Brian Kelley gravatar image

K. Brian Kelley
933 2

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1850
x738
x163

asked: Apr 04, 2011 at 12:55 PM

Seen: 6008 times

Last Updated: Apr 04, 2011 at 10:29 PM