Blog Home  Home RSS 2.0 Atom 1.0 CDF  
 
hoohee.com - How to fix SQL orphaned users?
 Wednesday, September 26, 2007

Have you ever had to reinstall SQL and then attach .mdb files or databases to your freshly installed instance?

If your .mdb database has users defined when you attach it, even if you create the respective user logins, they will be orphaned.

The simple fix is to use the stored procedure sp_change_users_login.

This is an example of how I use this procedure:

sp_change_users_login 'AUTO_FIX', 'myuser'

Replace 'myuser' with the usernames specified for your database.

A good webpage explaining the relationship between logons and users can be found at: http://vyaskn.tripod.com/troubleshooting_orphan_users.htm

9/26/2007 11:41:04 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]   MSSQL  | 
Copyright © 2008 Emile Bassil. All rights reserved.