Skip to content

Instantly share code, notes, and snippets.

@nedgrady
Last active November 28, 2021 22:53
Show Gist options
  • Save nedgrady/6b81561f162e0009e6842c790375c677 to your computer and use it in GitHub Desktop.
Save nedgrady/6b81561f162e0009e6842c790375c677 to your computer and use it in GitHub Desktop.
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