SQL Server Error 15023: User already exists in current database

This error occurs when users in a database are orphaned. Orphaned users are those users for which there is no login id associated with the database user.  This is a common occurence after restoring a database from a backup from one server to another.  Here’s the fix – run this query within the affected database.

EXEC sp_change_users_login ‘Update_One’, ‘<database user>’,‘<SQL Server Login NAME>’

 

Did you find this helpful?

Share it on social media!

THIS BLOG POST IS BY
Dean is one of the co-founders of Adaptive Solutions. He specializes in document and records management migrations and implementations.

Leave a Comment