The map all clause of the create compareset has several considerations and limitations.
When using the map all statement in create compareset, the source and target table columns must have identical names.
When the source table contains one or more identity columns, these columns are mapped as DA compareset key columns, and DA does not look for primary keys or unique indexes.
When the source table does not have any identity columns, but has one or more primary-key columns, these columns are mapped as DA compareset key columns. DA does not look for unique indexes.
When the source table does not have any identity or primary key columns, but has one or more unique indexes, the indexed columns are mapped as compareset key columns from the first unique clustered or first unique nonclustered index DA finds.
If no identity, primary key, or unique indexed columns are found, the create compareset command fails.
CREATE TABLE orders ( order_num INTEGER NOT NULL, date_ordered DATE, name CHAR(80) ) sp_primarykey orders, order_num go
create unique clustered index ordernumidx on orders (order_num) goYou can verify that a table has a primary-key constraint by using the sp_helpconstraint system procedure. See Specifying Unique and Primary Key Constraints in the Adaptive Server Enterprise Transact-SQL Users Guide.