MDD
MDD

Reputation: 274

How to get past Visual Studio Schema Compare constantly showing differences?

I've created a database project in my solution in Visual Studio 2013 and imported a database from a SQL server. I then did a SQL compare; the source is the database, the destination is the database project. The compare results are showing that one of my tables has changed. The only changes I see are differences in formatting, so I told it to update the destination. It did the update, I ran a new compare, and it is showing me that the same table has the same differences. Here are some example of differences:

  1. The left side has content on three consecutive lines, the right side has one or two blank lines within the content -- lines 56, 58, and 59 are blank.
  2. The left side is has content formatted on three lines:
    FOR INSERT,
    UPDATE,
    DELETE
    whereas the right side has that same content on one line:
    FOR INSERT, UPDATE, DELETE
  3. The left side has no trailing semicolon:
    FROM deleted
    whereas the right side does have a trailing semicolon:
    FROM deleted;

How do I get to a point where the compare says "everything is the same; no differences"? I haven't modified the table in my local database project; does anyone know why Visual Studio is saving it in a different format, and what I can do about it? The "Ignore whitespace" checkbox is checked.

Upvotes: 9

Views: 2195

Answers (1)

d219
d219

Reputation: 2835

I had this with a Table, although in my case the source was the DB Project, and basically ignored it (they were they same in SQL terms so everything worked as expected, it was just a bit of annoyance). However I then had a similar issue with a View ,expect this time it wanted to remove the View from the DB (even though it was present both there and in the VS DB project, with exactly the same text), this seemed a bit more serious and I was banging my head at it for an hour or so (OK enough of the preamble here's what solved it..)

Reverse the compare (so in my case updating the Project from the DB).

I did that, it thought there were differences, told it to update, no changes actually happened but it now seems fine with the compare both ways (fingers crossed).

Upvotes: 0

Related Questions