locked
error : Violation of PRIMARY KEY constraint... RRS feed

  • Question

  • Hi.
    I Have Merge Replication.Creation snapshot and synchronisation passes successfully, but on the party of the distributor I can add the data in table without errors.On the party of the subscriber i get error :

    Code Snippet

    Server: Msg 2627, Level 14, State 1, Line 1
    Violation of PRIMARY KEY constraint 'PK_Students'. Cannot insert duplicate key in object 'Students'.
    The statement has been terminated.

     

     


    i council has tried, but has not helped : http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2501481&SiteID=17

     

     

    subscriber 

    Code Snippet
    select @@version

     

     

    Microsoft SQL Server  2000 - 8.00.2039 (Intel X86)   May  3 2005 23:18:38   Copyright (c) 1988-2003 Microsoft Corporation  Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

     

     

    distributor

    Code Snippet
    select @@version

     

     

    Microsoft SQL Server  2000 - 8.00.2039 (Intel X86)   May  3 2005 23:18:38   Copyright (c) 1988-2003 Microsoft Corporation  Personal Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

    Monday, November 24, 2008 6:50 AM

All replies

  • Can you check to see if you are using an identity element on the students table? If so what is happening is that the same identity value is being assigned on the publisher and the subscriber between syncs. In this case what you will need to do is to use automatic identity range management.
    Monday, November 24, 2008 2:15 PM
    Answerer
  • Thanks

    Wednesday, November 26, 2008 5:39 AM