Microsoft SQL Server 2005 and SQL Server 2008 Fix Orphaned Users
- January 8th, 2010
- Posted in SQL Server . Technical
- Write comment
This is really for my benefit, but the quick and easy way to detect and fix orphaned Microsoft SQL Server users:
- Open a query in SQL Server and select the database you want to fix
- Run the following command query analyzer
:sp_change_users_login 'Report' - Create a list of the users that get reported back
- Make sure the users exist on the new servers, if they do not be sure to create the users
- Delete the command form query analyzer in step # 2
- Run the following command in query analyzer, replace “UserName” with the user name you want fix:
sp_change_users_login 'Auto_Fix', 'UserName'
Y0u can find a lot of articles going into lots of detail on how to fix this problem, but i know when I look it up I just want to see the command not why it does what it does. If you want a really good detailed article you can view this really good article.
No comments yet.