SQL Compare 13

User or role already exists in the current database / The login already has an account under a different user name

If a user needs to be added to a database as part of the deployment, then the deployment will fail if the login has already been granted access to the database under a different username. The error returned by SQL Compare is either "'User or role already exists in the current database" or "The login already has an account under a different user name".

This has been identified as an issue because SQL Compare should really revoke database access to the old user name before granting access to the same login under a new username. The suggested workaround is to select the users and roles that exist only in the database being deployed (database 2) and deploy only these objects, which has the effect of revoking the login access to the database first. After this deployment, a second deployment of the remaining objects should succeed and the login will once again be granted access to the database under the new username.


Didn't find what you were looking for?