Command Line ignoring Filter and Options arguments

Read through all the doc and have a script that will iterate through a list of databases to make scripts for each in a corresponding git repository folder.  I created a filter NoSecurity.scpf that unchecks Role, Schema and User objects.  Running the command, it still creates the Schemas and Users folders  with the corresponding files to represent the objects.... What?

Here's the kicker...
I set up a project in the UI with the exact same options and it performs as expected.

The command line is:

sqlcompare.exe /Server1:MY-SERVER /Database1:MyDatabase /Makescripts:c:\source\db-my_database\schema_objects /Options:NoAutoColumnMapping,DecryptPost2kEncryptedObjects,IgnoreFileGroups,IgnoreFillFactor,IgnorePermissions,IgnoreSchemaObjectAuthorization,IgnoreSystemNamedConstraintNames,IgnoreTSQLT,IgnoreUsersPermissionsAndRoleMemberships,IgnoreUserProperties,IgnoreUsers,IgnoreWhiteSpace,IgnoreWithElementOrder /Filter:NoSecurity.scpf /Verbose

Here is the verbose output:
SQLCompare V14.5.1.18536
Copyright © Red Gate Software Ltd 1999-2021

Argument /server1 has value 'EPC-PROD-SQL-1'
Argument /database1 has value 'MyDatabase'
Argument /makescripts has value 'c:\source\db-my_database\schema_objects'
Argument /options has value 'AddObjectExistenceChecks;NoAutoColumnMapping;DecryptEncryptedObjects;IgnoreFileGroupsPartitionSchemesAndPartitionFunctions;IgnoreFillFactor;IgnorePermissions;IgnoreSchemaObjectAuthorization;IgnoreSystemNamedConstraintAndIndexNames;IgnoreTSQLT;IgnoreUsersPermissionsAndRoleMemberships;IgnoreUserProperties;IgnoreUsersPermissionsAndRoleMemberships;IgnoreWhiteSpace;IgnoreWithElementOrder'
Argument /filter has value 'NoSecurity.scpf'
Argument /verbose has value 'True'

Redgate Client capability version: 2
SQL Compare: activated, edition professional
SQL Compare running with option: NoAutoColumnMapping (OK).
SQL Compare running with option: DecryptEncryptedObjects (OK).
SQL Compare running with option: IgnoreFileGroupsPartitionSchemesAndPartitionFunctions (OK).
SQL Compare running with option: IgnoreFillFactor (OK).
SQL Compare running with option: IgnorePermissions (OK).
SQL Compare running with option: IgnoreSchemaObjectAuthorization (OK).
SQL Compare running with option: IgnoreSystemNamedConstraintAndIndexNames (OK).
SQL Compare running with option: IgnoreTSQLT (OK).
SQL Compare running with option: IgnoreUsersPermissionsAndRoleMemberships (OK).
SQL Compare running with option: IgnoreUserProperties (OK).
SQL Compare running with option: IgnoreUsersPermissionsAndRoleMemberships (OK).
SQL Compare running with option: IgnoreWhiteSpace (OK).
SQL Compare running with option: IgnoreWithElementOrder (OK).

Best Answer

  • Jim_In_FloridaJim_In_Florida Posts: 7 New member
    Answer ✓
    After a lot of testing and analysis this is what I have come to believe.
    1. This behavior is as designed.
    2. /MakeScripts argument causes behavior to ignore the /Filter argument.  I ended up manually filtering the unwanted objects.
    3. /MakeScripts ignores specific options in the /Options argument that are associated with generating migration scripts.  Figuring out what those are is a trial and error operation.  You can glean some of it through the documentation by looking for options that mention migration.  Those are most likely to be ignored.
    4. The documentation Red Gate provides to it's customers is inadequate for the serious developer/integrator looking to use the tool to its maximum potential.  I don't know if that was unintentional or not.


Sign In or Register to comment.