Created
January 11, 2016 09:49
-
-
Save jamescoxhead/159006ca32298c58d7f7 to your computer and use it in GitHub Desktop.
Lists any roles associated with a SQL Server user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select DBPrincipal_2.name as role, DBPrincipal_1.name as owner | |
from sys.database_principals as DBPrincipal_1 inner join sys.database_principals as DBPrincipal_2 | |
on DBPrincipal_1.principal_id = DBPrincipal_2.owning_principal_id | |
where DBPrincipal_1.name = 'USER_NAME' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment