Snapshot Replication\Primary Keys

Posted on 2005-04-14
Last Modified: 2008-03-03
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?

Question by:michaelpg
    LVL 1

    Author Comment

    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?
    LVL 13

    Accepted Solution

    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.
    LVL 1

    Author Comment

    No way , i saw that option but i thought it only referred to foreign keys, i should have just tried it anyway.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now