Options

SQL Compare GUI works, but command line gives problems

valdeterovaldetero Posts: 3
edited November 5, 2008 10:37AM in SQL Compare Previous Versions
I recently purchased SQL compare 7.1 pro for the command line capabilities. We have been using the GUI version with no problems for some time now. I am trying to exclude items from the sync, however its not working.

I am using the .scp file created from the GUI. My syntax is:
SQLCompare.exe /pr:"file.scp" /v sync >> Log.txt.
I have tried the /exclude:Function and /exclude:user to exclude certain items and it still syncs them.

The only way that I could get it to exclude anything is if I went into the .scp file and changed the "DeselectItem" that I was excluding, to "SelectItem" and then do the exclude. This seems backwards because if someone opens the GUI to make a change, all of the checked/un-checked items will be backwards.

Thank you for your help.

Comments

  • Options
    Thanks for your post.

    I suspect the problem is because your GUI project file is configured to 'include dependencies' and some other objects included in the project for synchronization are dependent on those excluded functions and users. This would mean that they will be sync'ed regardless of being unchecked.

    If you are calling a project file from the command line you can remove the 'include dependencies' option by:

    1. Open the GUI project
    2. Run the Comparison
    3. Select the 'Synchronization Wizard' button
    4. Go to step 2. Dependencies
    5. Uncheck 'include dependencies'
    5. Cancel the Synchronization Wizard
    6. Refresh the comparison.
    7. Now when you run the command, the excluded objects should stay excluded.

    I hope this is helpful.
    Chris
  • Options
    I tried what you said and it didn't work. These items did not have any dependencies.

    Only the selected items get excluded from sync. But this seems backwards from how the GUI functions. In the GUI, only the selected items are synced. This means that we would have to invert all of the selections if we changed from command line to GUI.

    Maybe I'm missing something but here is my configurations:
    Commandline: sqlcompare.exe /pr:"file.scp" /v /exclude:User /exclude:StoredProcedure /exclude:Function /synch >> file.txt
    In the GUI:
    2 SPs with differences that are selected
    3 Functions exist in destination that are not selected
    1 User exist in destination that is selected
    When I run the above command in commandline, only the 3 functions are synced.
Sign In or Register to comment.