/project switch help is misleading

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

/project switch help is misleading

Postby isme » Fri Jul 19, 2013 6:39 pm

To see the verbose help, run this command:

Code: Select all
SQLCompare.exe /verbose /help


The help for the /project switch contains a message like this:

Code: Select all
/project:<project> (Alias: /pr)
    Uses a SQL Compare (.scp) or SQL Data Compare (.sdc) project file for
    comparison / migration. Note that options are not stored with the project so
    if you wish to use anything other than the default options you must use the
    /options switch to specify the options you want to use. You may also specify
    additional rules for including and excluding objects using the /include and
    /exclude switches.


This message contains two misleading statements.

The first is about project options:

Note that options are not stored with the project so if you wish to use anything other than the default options you must use the /options switch to specify the options you want to use.


It might have been true in the past, but it is no longer the case that a SQL Compare project file does not store options. The options are stored in the <Options> element.

My typical options look like this:

Code: Select all
<Options>IgnoreWhiteSpace, IncludeDependencies, IgnoreDatabaseAndServerName, DecryptPost2kEncryptedObjects, IgnoreTSQLT</Options>


It would be great if SQLCompare.exe could parse the options from the file.

At the very least, the documentation should phrase this as a limitation of the program rather than the project format.

It could say something like this:

Note that SQLCompare.exe does not parse the options stored in the project file. If you wish to use anything other than the default options you must use the /options switch to specify the options you want to use.


The second is about the /include and /exclude switches:

You may also specify additional rules for including and excluding objects using the /include and /exclude switches.


This would suggest to me that I can work around the fact that SQLCompare.exe ignores project filters by using the /include and /exclude switches.

When you try to combine the /project switch with the /exclude switch you see an error instead:

Code: Select all
Error: The /project switch cannot be used in conjunction with the /exclude switch.


It would be great if SQLCompare.exe could parse the inclusions and exclusions from the project.

At the very least, the documentation should make it clear that the switches can not be used together.

It could say something like this:

SQLCompare.exe does not parse the inclusion and exclusion rules from the project file. You can specify filters using the /include and /exclude switches, but not in conjunction with the /project switch. To use the /include and /exclude switches with other settings defined in the project, remove the /project switch and use the other switches to recreate the settings.


In an earlier forum post I documented an example of the surprising behavior this limitations produce.
isme
 
Posts: 81
Joined: Tue Jun 12, 2012 1:49 pm
Location: Edinburgh

Postby Brian Donahue » Mon Jul 22, 2013 3:34 pm

I believe the functionality of the command-line changed several times without corresponding change to the documentation. Thanks for pointing this out.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby isme » Thu Jul 25, 2013 1:39 pm

Thanks for the explanation, Brian.

Manfred Castro filed bug SC-6447 where SQLCompare.exe ignores project filters.

When the bug is fixed, it might be a good opportunity to update the documentation as well.
isme
 
Posts: 81
Joined: Tue Jun 12, 2012 1:49 pm
Location: Edinburgh


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest