sp_refreshview with Command Line Compare

Forum for users of SQL Compare schema synchronization utility

Moderators: JonathanWatts, Chris Auckland, David Atkinson

sp_refreshview with Command Line Compare

Postby mmJPM » Tue Dec 13, 2011 11:01 pm

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
 
Posts: 4
Joined: Tue Dec 06, 2011 10:23 pm

Postby Brian Donahue » Wed Dec 14, 2011 11:34 am

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
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Re:

Postby hugo » Mon Mar 26, 2012 8:18 pm

Brian Donahue wrote: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
 
Posts: 2
Joined: Mon Mar 26, 2012 8:14 pm

Postby Brian Donahue » Tue Mar 27, 2012 9:00 am

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.
Code: Select all
SQLDataCompare.exe /project:...
IF %ERRORLEVEL% EQU 63 GOTO EQUAL
EXIT /B %ERRORLEVEL%
EQUAL:
EXIT /B 0
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Wed Mar 28, 2012 9:09 am

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
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests