You may run into the 15023 error if you restore a MS SQL database from backup. You expect a restored database to be in exactly the same state as the backup, but the login fails for a user that had permissions in the backed up database. When you use the “User Mapping” SQL Management Studio functionality to allow the user permissions to the new database, you receive the 15023 error. This is caused by Security identification numbers (SID) that are mismatched or ‘orphaned’ in the sysusers table.
The SQL Server stored proc sp_change_users_login locates and fixes these records. Run it with a single parameter ‘Report’ to get a listing of abandoned user names and corresponding SIDs:
exec sp_change_users_login Report
The ‘Update_One’ parameter will reconnect a single login:
exec sp_change_users_login Update_One, ‘MyLogin’, ‘MyLogin’
You can find more info about this issue at:
This next blog expands on the available parameters for sp_change_users_login:
Also, try checking out the source for sp_change_users_login found in the Sql Server Management Studio under Databases | System Databases | Master | Programmability | Stored Procedures | sp_change_users_login.
Latest posts by Noel Rice (see all)
- Cross Device Testing - January 31, 2016
- Testing Sensors on Mobile Devices with Test Complete - January 30, 2016
- Automated Testing on iOS Controls with Test Complete - January 29, 2016
- Automating iOS User Actions - January 28, 2016
- Instrumenting iOS Apps, What could go wrong? - January 27, 2016