How can I write a query that will show something like:
[TT]
UserName(OrGroup) TableName Permission
lbrown Table1 SELECT
jbodine Table1 SELECT
DbUpdaters Table1 SELECT
DbUpdaters Table1 UPDATE
lbrown Table2 SELECT
jbodine Table2 SELECT
lbrown Table2 UPDATE
jbodine Table2 UPDATE
DbUpdaters Table2 SELECT
DbUpdaters Table2 UPDATE
[/TT]
I've gotten the following from a posting on mssqltips.com, and trying to edit for my current purpose. So I've gotten this which gives me sort of a framework of close to what I'm looking for, but still not really..
What I'm primarily after is to see what groups (listed with Users) have permissions to what tables/views/objects).
Thanks for any information,
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
[TT]
UserName(OrGroup) TableName Permission
lbrown Table1 SELECT
jbodine Table1 SELECT
DbUpdaters Table1 SELECT
DbUpdaters Table1 UPDATE
lbrown Table2 SELECT
jbodine Table2 SELECT
lbrown Table2 UPDATE
jbodine Table2 UPDATE
DbUpdaters Table2 SELECT
DbUpdaters Table2 UPDATE
[/TT]
I've gotten the following from a posting on mssqltips.com, and trying to edit for my current purpose. So I've gotten this which gives me sort of a framework of close to what I'm looking for, but still not really..
SQL:
SELECT SDP.state_desc, SDP.permission_name, SSU.[name] AS [Schema] ,SSO.[name], SSO.[type]
FROM MyDatabase.sys.sysobjects SSO
LEFT JOIN MyDatabase.sys.database_permissions SDP ON SSO.id = SDP.major_id
LEFT JOIN MyDatabase.sys.sysusers SSU ON SSO.uid = SSU.uid
WHERE SSO.type IN ('V','U')
ORDER BY SSU.[name], SSO.[name]
What I'm primarily after is to see what groups (listed with Users) have permissions to what tables/views/objects).
Thanks for any information,
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57