SQL Compare

Latest version: 10.0

SQL Compare

Knowledge Base

User or role already exists in the current database error

Category: Troubleshooting & error messages
Date: 04 Mar 2009
Product: SQL Compare
Versions: 6 - 8
Platforms: SQL Server 2000/2005

If a user needs to be added to a database as part of the synchronization, then the synchronization 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 synchronized (database 2) and synchronize only these objects, which has the effect of revoking the login access to the database first. After this synchronization, a second synchronization of the remaining objects should succeed and the login will once again be granted access to the database under the new username.

Document ID: KB200709000152 Keywords: SQL,Compare,user,role,already,exists,login,sp_revokedbaccess,Tro

Was this article helpful?

Search support
Forums
Visit the SQL Compare forum.

SQL Compare

all SQL products

all products