Options

Can't synchronize mapping between users and logins

ismeisme Posts: 119
edited October 21, 2013 9:53AM in SQL Compare Previous Versions
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.
Iain Elder, Skyscanner

Comments

Sign In or Register to comment.