create compareset foreach

Creates a compareset for each table after searching for all matching table names in the source and target databases.

Syntax

create compareset [compareset_name_prefix] foreach table
  with
    source source_connection_name owner_name
    target target_connection_name owner_name
    [and target target_connection owner_name]…
  [{include | exclude} table_name_pattern [and table_name_pattern]…]
  [set abort_on_collision  [{to|=}] {true|false}
    [and set commit_batch_size [{to|=}] number_of_comparesets
    [and set strict_all_columns [{to|=}] {true|false}    [and set strict_column_keys [{to|=}] {true|false}
    [and set strict_column_types [{to|=}] {true|false}
    [and set keep_computed_columns [{to|=}] {true|false}
    [and set keep_encrypted_columns [{to|=}] {true|false}
  ]]]]]]
go

Parameters

Examples

Usage

  • When overriding the default compareset prefix:
    • The compareset name prefix cannot begin with a digit.
    • Do not create unnecessary duplicate comparesets.
      Note: DA creates duplicate comparesets, if you run create compareset foreach multiple times with different prefixes.
  • You can use wildcards in the table_name_pattern. For example:
    • include a* and b* – includes all table names beginning with a or b only.

    • exclude *_???– excludes all table names that end with an underscore followed by any three characters, such as table_001 and table_002.

Related concepts
Wildcard Characters