[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

Snapshot Replication\Primary Keys

Hi There

I have a table being replicated using snapshot replication.
The table has a primary key, on the subscriber the index of the primary key is replcated but only has an index it is no loner a primary key on the subscriber.
Is there anyway i can transfer the primary key constraint with snapshot replication?

Thanx
0
michaelpg
Asked:
michaelpg
  • 2
1 Solution
 
michaelpgAuthor Commented:
Let me expand on the problem.
Server A is our OLTP system, i use snapshot replication to a developement environment once a week on a sunday night to Server B.
I then want to use transactional replication from Server B to Server C for other purposes.Problem is when the snapshot replication happens to Server B the primary key constraints are not transferred, i cannot implement transactional replication without primary keys from Server B to Server C?

If i make the index a primary key as soon as the next snapshot happens it becomes a normal index again even though i am not dropping the table at the subscriber only deleting all data?

Any advice?
0
 
TorrwinCommented:
When you are creating a publication, get to the step where you select the tables you want to replicate.  Click on a table you want to replicate.  Check the checkbox, and notice at the end of the row there is a "..." button.  Click that button, and select the "snapshot" tab.  Find the "Include declared referential integrity" checkbox, and check it.  Then press "OK".  You must do this for each table seperately.
0
 
michaelpgAuthor Commented:
No way , i saw that option but i thought it only referred to foreign keys, i should have just tried it anyway.
Thanx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now