Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Users with delete privilges to tables

Author  Topic 

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 2008-10-02 : 16:06:37
Guys,

How can I find out a list of users with DELETE privilege to a certain table?


Thanks a lot!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-02 : 16:19:42
Programmatically or through the GUI?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 2008-10-02 : 16:23:19
Programmatically.


Thank you for clarification!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-02 : 16:53:08
Look for sp_helprotect .
Go to Top of Page

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 2008-10-03 : 11:08:25
sodeep, thanks for the suggestion.

I decided to simplify my problem a bit, and just find out if a given user is a sysadmin.

This was achieved using the following script:

SELECT 'Username' = lgn.name
FROM master.dbo.spt_values spv, master.dbo.sysxlogins lgn
WHERE spv.name = 'sysadmin' AND spv.low = 0 AND spv.type = 'SRV' AND lgn.srvid IS NULL AND spv.number & lgn.xstatus = spv.number
AND lgn.name = @UserName


Thank you!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-03 : 12:14:41
Didn't understand why are you using like that?

Just simply use this:
select name from syslogins
where sysadmin =1
Go to Top of Page

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 2008-10-08 : 10:36:49
Sodeep,

I actually got this complicated code from inside one of the system stored procedures. Your solution is much simpler - Thank you!
Go to Top of Page
   

- Advertisement -