In SAP Replication Server Data Assurance Option (SAP DA) version 15.7.1 SP202, the create compareset and alter compareset commands allow you to specify the order of compareset key columns in order by clauses using an ordinal integer number in addition to a Boolean value.
Each key column must be a unique ordinal number within in the compareset. When a compareset has multiple key columns, ordinal integer numbers are used to decide the order of the keys in the order by clause. The order by clause is included in the select statement, which SAP DA issues to the source and target data servers when selecting data to compare.
create table person ( first_name varchar(50), last_name varchar(50), dob datetime, primary key(last_name, first_name) )
create compareset person with source conn1 dbo person s target conn2 dbo person t map s.first_name = t.first_name set key = 2 and s.last_name = t.last_name set key = 1 and s.dob = t.dob goWhen SAP DA selects rows from the “person” table for a comparison, this SQL query is generated:
select first_name,last_name,dob from dbo.person order by last_name,first_name
When you run the create compareset command with the map all parameter, SAP DA sets the compareset key column ordinal numbers in the optimal order itself.
show compareset person columns go TYPE CONNECTION OWNER TABLE MAPID COLUMN KEY ---- ---------- ----- ------ ----- ---------- ---- S conn1 dbo person 1 first_name 2 T conn2 dbo person 1 first_name 2 S conn1 dbo person 2 last_name 1 T conn2 dbo person 2 last_name 1 S conn1 dbo person 3 dob T conn2 dbo person 3 dob
See Compareset Commands in the SAP Replication Server Data Assurance Option Users Guide.