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.
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 |
|
sql_er
Constraint Violating Yak Guru
267 Posts |
Posted - 2008-10-02 : 16:23:19
|
Programmatically.Thank you for clarification! |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-10-02 : 16:53:08
|
Look for sp_helprotect . |
|
|
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 = @UserNameThank you! |
|
|
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 sysloginswhere sysadmin =1 |
|
|
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! |
|
|
|
|
|