Can't synchronize mapping between users and logins

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

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]
GO

/****** Object:  User [skytester]    Script Date: 18/10/2013 16:09:16 ******/
CREATE USER [skytester] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO


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'
GO
CREATE USER [skytester] FOR LOGIN [skytester]
GO


SQL Compare detects and displays the difference:

Image

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

Image

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:

Image

SQL Compare acts like it updates the scripts folder, but nothing really changes.
isme
 
Posts: 81
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: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests