SSDT Schema Compare keeps finding differences for users?
Asked Answered
C

4

14

The title says it all but for further details. When i use the schema compare tool in VS2015 for my SSDT Project and my database on a server. The compare results always come back with the Users as being different. I check the differences it speaks about but there is not a single difference between the environments.

I even went as far as updating my project from the compare results to try and correct these "differences". I then ran another compare and the same users came back with differences again... WHAT! haha.

Anyone have a clue what would cause this sync issue or am i doing something wrong? The users were added manually to the database on the server rather then thru SSDT deployment so maybe that is a reason?

EDIT:

enter image description here

Chlorine answered 3/12, 2015 at 19:40 Comment(3)
Any chance you can post a screenshot of the compare? Could there be trivial differences such as whitespace differences?Confect
Added the screenshot of one of the users it is saying there is a difference.Chlorine
I have the issue. When you drill in, under the properties folder, the DB side says UserType=2 whereas the project side says UserType=0. I can't find the user type in the project to change it. It's not in the user scriptPlastered
C
10

Please hit the arrow on the left of the user differences found. You will see a properties folder and the missing login which is the real difference. If you go Schema Compare Options -> Object Types (tab) -> Non-Application-scoped -> Logins to add Login object type to your comparison then your issue will be resolved.

Logins objects

Calamint answered 25/5, 2016 at 14:3 Comment(1)
This worked for me. Probably should be marked as the answer.Munsey
S
6

Although I consider this a bit of a workaround (I haven't found a real solution to get rid of the Users from the comparison even when they're indentical), it's the best I've found. Simply exclude Users from the comparison.

enter image description here

You can access this menu by clicking the gear icon on the Schema compare window and expanding the Application-scoped object and unchecking Users (or indeed anything you else you want to exclude).

Supremacy answered 10/12, 2015 at 10:42 Comment(0)
P
1

When I drill into the schema compare under Change > User > Properties > Spanner icon, I can see this difference:

Source (SQL Azure)    Target (Project)
=============         ===================
UserType=2            UserType=0

What does this mean? I googled to no avail.

Updating doesn't fix it. Deleting the user script from the project and Updating doesn't either.

I can't find UserType in the source code so this must be generated internally by the compare.

enter image description here

Plastered answered 5/9, 2018 at 2:4 Comment(1)
Have you ever figured out what the "UserType" is? I am having the same issue... does anyone else know?Cruise
B
0

In Visual Studio 2017 at least (and it looks like option is in 2015 as well), try going to Schema Compare options and under the "General" tab, untick the option "Ignore login SIDs".

I had this same problem with a user (where there wasn't a login defined for the user), and unticking this option resolved the problem for me. I still picked up actual correct user changes, but for existing users that are unchanged, the comparison no longer shows a bogus item.

Burette answered 16/3, 2018 at 15:53 Comment(2)
In my case the answer was the same thing, but for "Ignore user settings objects"Monanthous
Same thing resolved it for me...unchecking "Ignore user settings objects" under the General tab.Peregrination

© 2022 - 2024 — McMap. All rights reserved.