Solved

db_owner's permission

Posted on 2004-08-10
12
1,578 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:ScottPletcher
ScottPletcher earned 100 total points
Comment Utility
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_
Comment Utility
Perhaps the public role has an explicit deny.
0
 
LVL 6

Assisted Solution

by:andy232
andy232 earned 50 total points
Comment Utility
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
 
LVL 42

Assisted Solution

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

Can you post  -error message
0
 

Author Comment

by:Jinghui Li
Comment Utility
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
Comment Utility
> 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:Jinghui Li
Comment Utility
_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:ScottPletcher
ScottPletcher earned 100 total points
Comment Utility
?  If you're 'sa' you can test their permissions without actually logging in as that user.
0
 

Author Comment

by:Jinghui Li
Comment Utility
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
Comment Utility
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:ScottPletcher
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now