INF: How to Set Up Replication on Tables with an Identity ColumnID: Q190690
|
Replication does not transfer the IDENTITY property of the schema at the
subscriber. Because the data at the publisher is generated by the identity
column, there is no need for this at the subscriber. However, in some rare
cases, it is required to have an identical schema at the publisher and
subscriber. In such cases, the distribution task will fail with an error if
the table at the subscriber has an identity column.
This article provides the steps to set up replication on tables that have
an identity column.
To replicate to a table at the subscriber that has an identity column,
perform the following steps:
create proc cp_insert_table @c1 datatype, @c2 datatype
/* The columns will be passed in order. */
as
begin
set identity_insert <tablename> on
insert tablename values (@c1, @c2)
set identity_insert <tablename> off
end
Additional query words: repl ident col field dist sync synch
Keywords : SSrvRep
Version : WINNT:6.5
Platform : winnt
Issue type : kbhowto kbinfo
Last Reviewed: April 15, 1999