The information in this article applies to:
SUMMARY
In replication, the distribution task fails with the following error
message when both the article published and the subscribing table have a
timestamp column defined:
This problem occurs because the script generated by the synchronization task has defined binary (8) for the timestamp column (this is documented behavior). However, when the table already exists on the subscriber, the Bulk Copy Program (BCP) fails to replicate the data into the table on the subscriber, with the error generated by the distribution task. MORE INFORMATION
The behavior of the distribution is largely by design. Timestamp is not
supported as a datatype for replication, because it is not necessary to
have identical values on published and subscribed articles for the
timestamp column. The timestamp is only useful as an indication of the
order of appearance of transactions on any given table in a database. In
most cases, preserving the order of appearance of the transactions is
sufficient. Thus, in replication, it is not possible to achieve the same
values, although you can have a subscribed table with the same order of the
rows, by using timestamp values and performing the following steps:
TABLE: tmstmp (col1 int not null PRIMARY KEY, col2 int, col3 timestamp) Further, assume the following data is present on the table in the publisher: TABLE: tmstmp on XXX has the following rows:
In terms of data, the publisher and subscriber must be synchronized manually. It is the responsibility of the user who is doing the replication to do the synchronization as well. For more information about manual synchronization, see the SQL "Administrator's Companion 6.0" and Books Online. After manual synchronization, the subscribing table has similar data to the publishing table. However, the timestamp values will be different, because they are generated on that subscribing server. For example, the subscriber may contain the following data: TABLE: tmstmp on YYY has the following rows:
Continuing the example, perform the following steps:
For example, assume the following transaction is applied on publisher XXX:
This statement will add an entry in the tmstmp table on the publisher. The timestamp value will be automatically generated, so the row in tmstmp on publisher may be:
The logreader will read in this replicated transaction to the distribution database. The distributor will attempt to apply this transaction to the subscriber. However, due to the use of the custom stored procedure for INSERT (note that you can have custom stored procedures for DELETE or UPDATE as well, but only INSERT is used in this example), the following command is generated in the Msjob_commands table:
The stored procedure is called, and as it performs an INSERT with a column list (see the stored procedure text given above), the timestamp value is automatically generated on the subscriber, and a row similar to the following row is successfully added to the subscribing table:
Thus, a "replication of timestamp" is achieved.
Keywords : kbusage SSrvBCP SSrvRep |
Last Reviewed: April 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |