User, group, or role already exists in the current database

por | 22 agosto, 2022

You moved the database to another instance and created a new login for this database instead of moving the login from the old instance to the new instance. I recommend that you read my article “How To Move Logins To Another Instance(sp_help_revlogin)”.

You may receive this error when you want to authorize the login that you created for the database that you transferred. The reason for the error is that there is a user with the same name as the login you created in the database. This user in the database is known as orphaned user.

The error is as follows;

Create failed for User ”.

User, group, or role already exists in the current database

1) Delete the corresponding user from the Users tab under Database and re-authorize:

For the authorization process, I suggest you read my article “How To Create a Login On SQL Server(Manage Logins)“.

2) Pairing the Login and the user:

1ALTER USER test WITH LOGIN = test

3) Pairing the Login and the user:(This is old method before SQL Server 2008)

12EXEC sp_change_users_login ‘Update_One’, ‘test’, ‘test’;GO