Can't synchronize mapping between users and logins

Forum for users of SQL Compare schema synchronization utility

Can't synchronize mapping between users and logins

Postby isme » Fri Oct 18, 2013 5:27 pm

SQL Compare can't synchronize the mapping between users and logins.

If the user is defined as WITHOUT LOGIN in the database and FOR LOGIN in the repository, SQL Compare can detect the change, but it can't synchronize it.

In my database I have a skytester user without a login. In the repository, the user definition maps the user to a login with the same name.

SQL Server Management Studio scripts out the user object like this:

Code: Select all
USE [KeyConfig_API]

/****** Object:  User [skytester]    Script Date: 18/10/2013 16:09:16 ******/

The definition file skytester.sql currently looks like this:

Code: Select all
IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'skytester')
CREATE LOGIN [skytester] WITH PASSWORD = 'p@ssw0rd'
CREATE USER [skytester] FOR LOGIN [skytester]

SQL Compare detects and displays the difference:


When I try to deploy the change, the deployment wizard warns me that my database might be corrupt:


This warning always appears for users without logins. It's safe to ignore.

When I try to commit the changes using TortoiseSVN, there are no changes to commit:


SQL Compare acts like it updates the scripts folder, but nothing really changes.
Posts: 83
Joined: Tue Jun 12, 2012 1:49 pm
Location: Edinburgh

Postby Brian Donahue » Mon Oct 21, 2013 2:53 pm

Thanks for pointing this out. I have logged this as SC-6018, so the development team should be looking at it.
Brian Donahue
Posts: 6590
Joined: Mon Aug 23, 2004 10:48 am

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests