Options

Command line - include switch

mattjharpermattjharper Posts: 4 Bronze 1
edited June 9, 2016 5:08AM in SQL Compare 11
Hi

I’m trying to compare one stored procedure across databases using the command line. I want the report to include a record even if the object is identical.

My xml looks like this:
<?xml version="1.0"?>
<commandline>
  <database1>database_name1</database1>
  <server1>server_name1</server1>
  <database2>database_name2</database2>
  <server2>server_name2</server2>
  <include>StoredProcedure</include>
  <include>StoredProcedure:[stored_procName]</include>
  <report>Reports
edgate.html</report>
  <reportType>Interactive</reportType>
  <out>Reports
edgate.txt</out>
  <OutputWidth>100</OutputWidth>
  <Force/>
</commandline>

This returns data if there are differences, but nothing if they are identical. If I add <include>Identical</include> then all identical objects in the database are returned. Is there any way to always return a record regardless of the comparison type?

Thanks

Comments

  • Options
    Eddie DEddie D Posts: 1,781 Rose Gold 5
    Thank you for your forum post.

    I suspect that you may need to use the exclude switch to exclude the other object types. This means adding the the exclude switch several times. Unfortunately you cannot place all the object types between a single set of the <exclude> and</exclude> tags:

    CODE: SELECT ALL
    <?xml version="1.0"?>
    <commandline>
    <database1>database_name1</database1>
    <server1>server_name1</server1>
    <database2>database_name2</database2>
    <server2>server_name2</server2>
    <include>StoredProcedure</include>
    <include>StoredProcedure:[stored_procName]</include>
    <exclude>Assembly</exclude>
    <exclude>AsymmetricKey</exclude>
    <exclude>Certificate</exclude>
    <exclude>Contract</exclude>
    <exclude>DdlTrigger</exclude>
    --remaining objects types
    <exclude>Table</exclude>
    <exclude>User</exclude>
    <exclude>UserDefinedType</exclude>
    <exclude>View</exclude>
    <exclude>XmlSchema</exclude>
    <report>Reports
    edgate.html</report>
    <reportType>Interactive</reportType>
    <out>Reports
    edgate.txt</out>
    <OutputWidth>100</OutputWidth>
    <Force/>
    </commandline>

    Another way if you make use of SQL Source Control, is to use the Filter .scpf file saved from a SQL Source Control project. This will save you having to type all the include and exclude switches.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.