Technical

Orphaned SQL Server Users

PINT Team

Moving databases from one server to another running MS SQL Server can result in orphaned database users. This is because the database user isn’t properly mapped to the SQL server login on the new server. Surprisingly, the only way to fix this is by running a stored procedure called sp_change_users_login. Hopefully you’re aware of this before you try and move your production database at 2AM (yes, we’ve been there).

There are a few actions this procedure can take: auto_fix, report, and update_one. Running sp_change_users_login ‘report’ will show you an orphaned users. If you’ve already created the same user on the new sql server you probably just want to use: sp_change_users_login ‘update_one’, ‘joe’, ‘joe’ where joe is the username. You can read more about usage here.

Related Articles

Designing for Digital and Print

Having consistent messaging, look, and feel is essential to providing a seamless experience for users. Translating that across digital and print can be a challenge. ...

Rob McFarlane
By Rob McFarlane
Oct 29th, 2018

All The Tests: PINT’s Overview of Web Testing

To help you get started with testing, we’ve compiled some of the basics: Types of Tests you’ll want to consider and the concept of The Testing Pyramid. ...

Preston Resenbeck
By Preston Resenbeck
Sep 18th, 2018

Tell us about your project

Please fill out your information and submit
X