SharePoint has a button to "Check Permissions". Here you can select a user from Active Directory, and it will magically traverse groups and show you all the access the user has on the site based on what groups they are in.
This is a long shot as I've been working with SQL Server for quite a while and have never heard of this, but just in case I missed something…
Is there anything similar in SQL Server? Right now, checking permissions involves looking at the AD groups that have logins on the instance, and going through AD manually to see who is in which group, and then look at database permissions manually. A "Check Permissions" like SharePoint could save a lot of time.
Best Answer
You can accomplish this using following code:
Or you can impersonate that login and use sys.login_token like this: