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 |
sqlpal2009
Yak Posting Veteran
58 Posts |
Posted - 2009-03-09 : 11:07:23
|
Hello All,This command gives me the details on users who have SELECT/INSERT/UPDATE/DELETE privileges on a sql table. But this list includes theose users as well who have access through a role.I wanted to see only the users having direct access. How would I do that?exec sp_table_privileges 'tablename'Thanks,-S |
|
guptam
Posting Yak Master
161 Posts |
Posted - 2009-03-09 : 18:45:24
|
Try ..SELECT object_name(major_id) As ObjectName, DP.Name AS UserName, Permission_Name FROM sys.database_permissions AS DPerINNER JOIN sys.database_principals AS DP ON DP.principal_id = Dper.grantee_principal_id WHERE DP.name = 'guest'-- Mohit K. GuptaB.Sc. CS, Minor JapaneseMCITP: Database AdministratorMCTS: SQL Server 2005http://sqllearnings.blogspot.com/ |
 |
|
|
|
|