Options

sp_refreshview with Command Line Compare

mmJPMmmJPM Posts: 7
When I run a compare from the command line, a call to sp_refreshview is generated for every view in my database, even when there are no dependencies on the objects that have differences. This even happens when there are no differences and I've used the /Include:Identical switch. If I run the same compre from the U.I., it does not script the sp_refreshview calls.

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Thanks, this is a known issue. Bug reference is CSD-157. According to the bug report, if you do not include identical objects, sp_refershview will not be run on the views that don't have differences.
  • Options
    hugohugo Posts: 2 Bronze 1
    Thanks, this is a known issue. Bug reference is CSD-157. According to the bug report, if you do not include identical objects, sp_refershview will not be run on the views that don't have differences.

    Hi, I am having the same issue. The problem with not including identical objects, i.e. not using /include:identical is that, if there are not differences, the exit code will be an error, and since I am using it with an automated build tool, my entire build is failing... do you have an update on this? I am using SQL Compare 9.0.

    Thank you!
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I can't say when, if ever, this behavior will change, as it's been explained to me, it's intentional.

    In the meantime, I have suggested previously that you run a batch file in the build instead (cmd /c), and capture the errorlevel and throw back a 0 if SQLCOMPARE returns a 63.
    SQLDataCompare.exe /project:...
    IF %ERRORLEVEL% EQU 63 GOTO EQUAL 
    EXIT /B %ERRORLEVEL%
    EQUAL:
    EXIT /B 0
    
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    SQL Compare 10.1 has a new switch called /assertidentical, which should solve the issue without having to include identical objects. This is not documented at this time, but it is in the latest version.
Sign In or Register to comment.