August 28, 2014 at 4:35 pm
Hi,
Thanks for taking time to look in to my question.
I am looking to write a script that would give the list of all active users in a database with their privileges.
Sample would look something like this.
Login User Schema IsdbOwner canWrite canRead
xyz xyz dbo N Y Y
Can you help?
Thanks!
August 29, 2014 at 8:07 am
Most of this information can be returned by starting with sys.database_principals, sys.database_role_members, and sys.database_permissions. You may want to use a recursive CTE to get all the role information because a role could be inside a role and then join the CTE to sys.database_permissions.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
August 29, 2014 at 10:20 am
Hi Jack.
Thanks for your reply. Let me try that.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply