Try this: Brief and nice.
SELECT
A.ROLENAME,
A.GRANTEE,
A.GRANTOR,
A.DefaultRole,
A.WithAdmin,
B.DATABASENAME,
B.TABLENAME,
B.COLUMNNAME,
B.GRANTORNAME
--,B.AccessRight
FROM
DBC.ROLEMEMBERS A
JOIN
DBC.ALLROLERIGHTS B
ON A.ROLENAME = B.ROLENAME
--WHERE Grantee='sandeep'
GROUP BY 1,2,3,4,5,6,7,8,9--,10
ORDER BY 2,1,6;
↧