Command Line - compare and do not include identical

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Command Line - compare and do not include identical

Postby rre » Tue Mar 11, 2014 12:04 pm

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.

Code: Select all
<?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>
rre
 
Posts: 30
Joined: Thu Jul 07, 2011 2:13 pm

Postby Brian Donahue » Fri Mar 14, 2014 12:47 pm

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

Postby Brian Donahue » Fri Mar 14, 2014 12:47 pm

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

Postby rre » Mon Mar 17, 2014 3:28 pm

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?
rre
 
Posts: 30
Joined: Thu Jul 07, 2011 2:13 pm

Postby Brian Donahue » Mon Mar 17, 2014 5:36 pm

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


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests