Command line produces sp_RefreshView commands in script


I am trialling the latest version of SQL Compare (

When I run the compare via command line, the script ends up containing a sp_RefreshView line for each view however via the UI they don't appear.

The differences between my db1 and my db2 are only 2 stored procedures, so I am not expecting this sp_RefreshView in the synchronisation script.

Furthermore, I have checked and rechecked the /options in the command line vs the UI and they are identical. The script file between the command line interface and the UI end up being the same except for these silly sp_RefreshView commands.

I believe there is a bug in the command line interface. If so is there a fix available or is there a workaround somehow?

If it helps at all, here is my command line...

"c:\Program Files\Red Gate\SQL Compare 8\sqlcompare" /s1:localhost /db1:myDB_A /u1:sa /p1:sa /s2:localhost /db2:myDB_B /u2:sa /p2:sa /exclude:Identical /o:adus,nc,nt,iw,icm,iu,if,ifg,ic,iup,iweo,idsn /sf:DatabaseDelta.sql /f



  • Thanks for you post.

    There is indeed a bug with the command line that causes this behaviour. The problem is that the UI filters out the indentical objects from the sync, but the CL doesn't. The artifact of having identical objects in the sync is that the sync script decides to refresh all the views.

    You should have prevented this behaviour using the /exclude:Identical switch. However, we have another bug in the release version that makes /exclude:identical case sensitive.

    Can you try the same command again, but use a lower case i in 'identical'?

    We have a patch version that addresses this case sensitive issue that you can download from here

    I hope this helps,

    Let me know how you get on.

    P.S. for your reference, the bug tracking number for the sp_refreshview issue is SC-4542. It should be fixed in the next release.
Sign In or Register to comment.