The corresponding fields (columns or parameters) of primary and replicate objects must have compatible datatypes and length. Ideally, the datatype and length of a published field should be the same as the datatype and length of the corresponding field in a replicate object.
If a column is identified in the replicate table’s primary key constraint, errors can result if its datatype is not identical to the datatype of the corresponding primary table column.
When the datatype and length of a replicate object’s field is not compatible with the published datatype, errors occur.
To find the cause of a datatype incompatibility, you must check the mapping between the primary article published fields and the replicate article subscribed fields.
For example, if a primary article publishes the following four fields:
column1 – bit
column2 – varchar(64)
column3 – smallint
column4 – varchar(255)
and a replicate article subscribes to published fields 2, 3, and 4, the first three columns in the replicate object should be defined with the corresponding datatypes:
column1 – varchar(64)
column2 – smallint
column3 – varchar(255)
As an alternative, the first three columns in the replicate object may be defined with different, but compatible datatypes, such as:
column1 – varchar(128)
column2 – int
column3 – varchar(1024)
The published fields that a replicate article subscribes to are always mapped to the first available fields (columns or parameters) in the replicate object.