9

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.

MDD
  • 147
  • 9
  • I frequently suffer the same problems - in both directions. Even if I get a clean comparison (no differences) in one direction. If I swap the source and target, then compare again, I usually have differences that hard next to impossible to pin down and clear. – Zarepheth Dec 15 '16 at 16:15
  • 1
    I found that Visual Studio schema compare simply wasn't reliable or accurate enough, so I ended up switching to Redgate SQL Compare which has worked flawlessly. It's not free though :( – John M Jan 14 '20 at 14:20

1 Answers1

0

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).

d219
  • 2,707
  • 5
  • 31
  • 36