Last active
November 28, 2021 22:53
-
-
Save nedgrady/6b81561f162e0009e6842c790375c677 to your computer and use it in GitHub Desktop.
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 old_roles.principal_id, | |
old_roles.name, | |
old_roles.create_date | |
from sys.database_principals old_roles | |
where old_roles.create_date < DATEADD(DAY, -365, GETDATE()) | |
and old_roles.type = 'R' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment