Merge Replication Internal Error when Filtering

  • I have a merge publication on a SQL Server 2008 instance. The subscription exists on a SQL CE database. Everything works fine, until I try to add replication filters. If I add only one filter to the publication, I can create the subscription just fine. I can also go back and add new filters one-by-one, and everything works. However, if I create more than one filter at a time, no matter how many tables I include in the publication, I get the following error:

    TITLE: Microsoft SQL Server Management Studio

    ------------------------------

    The referenced table must have a primary or candidate key. [ FK Name = FK_Residents_ResidentStatus ]

    HRESULT 0x80004005 (28599)

    The SQL statement failed to execute. If this occurred while using merge replication, this is an internal error. If this occurred while using RDA, then the SQL statement is invalid either on the PULL statement or on the SubmitSQL statement. [ SQL statement = ALTER TABLE "Residents" ADD CONSTRAINT "FK_Residents_ResidentStatus" FOREIGN KEY ( "ResidentStatusKey" ) REFERENCES "ResidentStatus" ( "ResidentStatusKey" ) ON UPDATE CASCADE ]

    HRESULT 0x80004005 (28560).

    Can someone please advise? I can give more detail if needed. Thanks in advance!

  • Hi,

    In replication, you cannot replicate a table without primary key. Please check the table has primary key and update the status.

    Thanks

    Sam

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply