SQL Server | Error 15023: User already exists in current database

So, you changed a SQL server database to a new server and now you can’t add the old user for this database.

And after every single attempt to add the user name you see this error message: “Error 15023: User already exists in current database” That means your database has an orphan username.

In order to solve this open a SQL Query Analyzer session and connect to your database (with the ‘sa’ username) and then run this query:

EXEC sp_dropuser 'orphan_username'

This query will do the dirty job and drop the user from the database, now you can add the user with this query:

EXEC sp_adduser 'orphan_username'

Or through the GUI, easy, don’t you think?

About javier

Mexicano, Ingeniero en Sistemas egresado del Instituto Tecnológico de Durango, Maestro en Software Libre por la Universidad Autónoma de Chihuahua. Apasionado de medio tiempo de la fotografía y guitarrista de closet.
This entry was posted in Bases de Datos, Microsoft, Software, Tips, Windows. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *