| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Jun27

Written by:R Teachout
6/27/2008 10:06 PM 

How to Find Orphaned Users on a database use database; exec sp_change_users_login 'Report'

use [yourdatabasename]
exec sp_change_users_login 'Report'

Will Output Something like:
user1 0x68940EDA46DDD44E9E25F834E4839F74
bsmith 0x37D7D1FFAC865F44AB99CABFA92E5932
jdoe 0xD12465F809AD2940AAFBB938F0270A9C
webuser 0x7C4538615AFD874E999A528283A5793B

These are the orphaned users.

Enjoy!

Tags:

1 comment(s) so far...

Re: MSSQL: Find Orphaned Users on a database

Here's a way to run it for ALL databases on a server

exec sp_MSforEachDb 'use ?; select ''?'' as DB; exec sp_change_users_login ''Report'''

This will give a list of results that has 2 queries in the listFirst: The database it's for, Second: The list of orphaned usersSweet

By host on  12/22/2009 1:07 PM

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

To succeed in the world it is not enough to be stupid, you must also be well-mannered.
-Voltaire

Inspired by Nina