Creates a compareset for each table after searching for all matching table names in the source and target databases.
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_types [{to|=}] {true|false}
[and set keep_computed_columns [{to|=}] {true|false}
[and set keep_encrypted_columns [{to|=}] {true|false}
]]]]]]
go
Parameter | Value |
---|---|
abort_on_collision |
A compareset name generated during the execution of this command might match an existing compareset name (either created manually or through an earlier invocation of this command). When this parameter is set to true and a generated compareset name matches an existing compareset name, the command aborts immediately and all uncommitted comparesets are discarded. Valid values: true or false. Default: true. |
commit_batch_size |
The number of comparesets DA server stores in memory before committing them to the internal database. If an error is generated, all uncommitted comparesets are discarded. Valid values: 1 to 2147483647. Default: 1000. |
strict_all_columns |
When this parameter is set to true and one of the target tables does not contain all of the source columns, no compareset is generated. Valid values: true or false. Default value: false. |
strict_column_types |
When this parameter is set to true and any target column type does not exactly match the source column type, no compareset is generated. Valid values: true or false. Default: false. |
keep_computed_columns |
Whether to include computed columns in the compareset column mappings. Valid values: true or false. Default: false. |
keep_encrypted_columns |
Whether to include encrypted columns in the compareset column mappings. Valid values: true or false. Default: false |
create compareset foreach table with source conn_venus dbo target conn_pluto dbo go
create compareset cmpset_ foreach table with source conn_venus dbo target conn_pluto dbo exclude rs_* go
create compareset cmpset_ foreach table with source conn_venus dbo target conn_pluto dbo exclude rs_* set abort_on_collision false and set commit_batch_size 100 go
create compareset foreach table with source conn_venus dbo target conn_pluto dbo and target conn_earth dbo include customer_* and cust_* set strict_all_columns true and set strict_column_types true go
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.