Command Line - compare and do not include identical

rrerre Posts: 42 Bronze 2
edited March 17, 2014 12:36PM in SQL Compare Previous Versions
Hello,
we are using the command line tool of SQL Compare and I want to archive to get a comparison report in conjunction with the script file and not including the identical objects into the comparison report.

Currently I have to specify all the time the switch include:identical to avoid the exit code 63. So far so good. In the relase notes for 10.4 I read that with the ticket SC-6165 it is fixed.
For me it's still the case. I doing something wrong?
Basically SQL Compare should exit without an error and show me only the differences in the comparison report? Identical objects should be excluded from the report.

May be the switch /assertidentical could help me. But unfortunately it tells me that I can't used it together with the scriptfile parameter.

For doing so I am using the XML file feature.
<?xml version="1.0" encoding="utf-8"?>
<commandline>
    <scripts1>snapshot</scripts1> 
    <server2>.</server2>
    <database2>MyDatabase</database2>
    
    <exclude>Role</exclude>
    <exclude>User</exclude>

    <!-- avoid getting error number 63 (Databases identical) -->
	<include>identical</include>

    <options>IgnoreWhiteSpace,IgnoreDatabaseAndServerName,IgnoreWithElementOrder,IgnoreUserProperties</options>	

    <scriptfile>C:\solutions\logs\MyDatabase\UpdateDbStructure.sql</scriptfile>
    <report>C:\solutions\logs\MyDatabase\UpdateDbStructure.html</report>
    <reporttype>Interactive</reporttype>
</commandline>

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I've had a look at SC-6165 and it says this is about getting identical results in the report when you use the /exclude:identical argument. This is now fixed. However you have a peripheral issue where you need to include identical to rid yourself of error code 63. Unfortunately you cannot both exclude identical records and avoid error code 63.

    What I typically recommend is to wrap the command into a batch file where you can trap error code 63 and return 0 instead using EXIT /B like this:
    http://www.red-gate.com/messageboard/vi ... hp?t=14969
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I've had a look at SC-6165 and it says this is about getting identical results in the report when you use the /exclude:identical argument. This is now fixed. However you have a peripheral issue where you need to include identical to rid yourself of error code 63. Unfortunately you cannot both exclude identical records and avoid error code 63.

    What I typically recommend is to wrap the command into a batch file where you can trap error code 63 and return 0 instead using EXIT /B like this:
    http://www.red-gate.com/messageboard/vi ... hp?t=14969
  • rrerre Posts: 42 Bronze 2
    Thanks, for sharing this forum post. This helps me a lot, because it's sounds like that I am not the only one having this problem.

    Do you think there will be a feature coming to avoid executing SQL Compare twice? Or do I have to do a feature request on the uservoice?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Uservoice may be the best option - I think we considered the matter closed when SQL Compare was changed so error code 63 was negated when you included identical. In the case where you don't want identical or error code 63 it's not the best solution.
Sign In or Register to comment.