How can we help you today? How can we help you today?

sp_refreshview with Command Line Compare

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.
mmJPM
0

Comments

4 comments

  • Brian Donahue
    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.
    Brian Donahue
    0
  • hugo
    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!
    hugo
    0
  • Brian Donahue
    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
    
    Brian Donahue
    0
  • Brian Donahue
    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.
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.