Search

Thursday, July 28, 2011

How to transfeer Primary key in replication

This is how transfer primary keys in replication:

To replicate primary/foreign keys, we need to enable an option for the
article.

1. In the SQL Enterprise Manager, drill down to Databases -> your
publishing database -> Publications.
2. Right click the transactional publication under the Publications node,
click Properties.
3. Click the Articles tab, click the ¡¬ button near an article that you
want to replicate the primary/foreign key.
4. Click the snapshot tab, check the "Include declared referential
integrity" option.
5. Click the snapshot tab, check the "delete all data in the existing table" option.

This requires us to have created the tables manule at first or provid the snapshot agent with an script to create those before applying the snapshot. I prefeer to create the table manualy before i set up the transaction.

No comments:

Post a Comment