How can we help you today? How can we help you today?

Can't synchronize mapping between users and logins

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:
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:
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:

ji3gASG.png

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

912vdZO.png

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:

MpaEblM.png

SQL Compare acts like it updates the scripts folder, but nothing really changes.
isme
0

Comments

1 comment

  • Brian Donahue
    Thanks for pointing this out. I have logged this as SC-6018, so the development team should be looking at it.
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.