Blog

Orphaned SQL Server Users

Orphaned SQL Server Users

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

Technical

Accessibility on the Modern Web

There’s been a lot of buzz in the news lately about accessibility, specifically in reference to the dozens of ADA lawsuits that seem to be more and more...

Technical

Automated Visual Regression Testing

What is automated visual regression testing? The name sounds scary, but in reality, the idea is fairly simple. If you have a user interface (UI),...

Technical

Automated Testing Tool Comparisons

Automated testing is rapidly gaining popularity across the web development field, and as expected, the number of automated testing tools is growing rapidly as well....