Skip to content

Instantly share code, notes, and snippets.

@JosiahSiegel
Created July 22, 2015 14:46
Show Gist options
  • Save JosiahSiegel/2a3a7dd318a12330b74e to your computer and use it in GitHub Desktop.
Save JosiahSiegel/2a3a7dd318a12330b74e to your computer and use it in GitHub Desktop.
#MSSQL #Research #Users Find matching login for user
SELECT sp.name AS login_name
FROM sys.server_principals sp
JOIN sys.database_principals dp ON (sp.sid = dp.sid)
WHERE dp.name = 'Joe'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment