Solved

db_owner's permission

Posted on 2004-08-10
12
1,586 Views
Last Modified: 2008-03-10
A user is in db_owner role.  But she cannot delete a record in a table.  So I explicitly grant her the delete previldge in the table via enterprise manager.  Nothing changes.

Please advise why.

biang
0
Comment
Question by:Jinghui Li
  • 5
  • 3
  • 2
  • +2
12 Comments
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 100 total points
ID: 11765928
A db_owner does not need explicit permission to delete a record in the table.  Something else must be causing the error, possibly:

1) Connected to a different server & db by mistake
2) Connected to a different db by mistake
3) Error in connection
4) Error in application/interface
0
 
LVL 9

Expert Comment

by:_ys_
ID: 11765963
Perhaps the public role has an explicit deny.
0
 
LVL 6

Assisted Solution

by:andy232
andy232 earned 50 total points
ID: 11765967
good answers.  I would also check the table for triggers.  I would also run SQL Profiler and watch what happens.  You should try logging in as the user in Query Analzyer and running the delete.  You'll usually get a good error message there
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 42

Assisted Solution

by:EugeneZ
EugeneZ earned 50 total points
ID: 11766034
also check relationship - FK PK of the table

Can you post  -error message
0
 

Author Comment

by:Jinghui Li
ID: 11766336
I ran the following query in Query Analyzer

DELETE  FROM  dbo.tbl1  WHERE     (Id = N'000000000')

Error Msg was

Server: Msg 229, Level 14, State 5, Line 1
DELETE permission denied on object 'tbl1', database 'xxx', owner 'dbo'.


I tried SQL Profiler but I did not know what the trace needs to record.  

Public role is not issue.  

What should I pay attention to about -FK PK
0
 
LVL 9

Accepted Solution

by:
_ys_ earned 300 total points
ID: 11766645
> Public role is not issue.
Suggestion of public just an example. Are there any explicit denies at all?

> What should I pay attention to about -FK PK
You can't delete a PK whilst there's a FK to it. Basic database integrity. But the error message doesn't indicate this.
0
 

Author Comment

by:Jinghui Li
ID: 11766773
_ys_

I think you get it.  There is another role which has explicit denies on delete.  I have not tested it yet as I cannot log in as the person now.
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 100 total points
ID: 11767187
?  If you're 'sa' you can test their permissions without actually logging in as that user.
0
 

Author Comment

by:Jinghui Li
ID: 11767233
Yes I have the system roles - System Administrators.  I also find out the sa login if I really want to.  Do I have to use 'sa'?  And how should I test their permissions?

Thanks
0
 

Author Comment

by:Jinghui Li
ID: 11767520
The person came back and it worked.

But I still love to get help on 'test their permission withou acutually loggin in as that user'.
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 11767564
Go into Query Analyzer and issue this command:

SETUSER 'optionalDomain/userYouWantToSimulate'

Then any commands you issue will use the permissions of that user.

To reset back to your sa user, do this:

SETUSER  --[with no params]
0
 

Author Comment

by:Jinghui Li
ID: 11767568
I have set up another question for 'test their permission withou acutually loggin in as that user'.

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21089042.html
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question