SQL 2005 Transaction Replication error Alter table conflicted with Foreign key constraint

  • I am trying to set up transactional replication. I have one database where there are certain tables(user tables) that we want to replicate to other servers. I set up the publication and everything seems to be fine and the creation of the subscription seems to be fine. However, when I look at the distributor to subscriber history I get an error:

    The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "Relation_232". The conflict occurred in database "db name", table "table name", column "column name". (Source: MSSQLServer, Error number: 547)

    I have modified that constraint on the publishing database to "Enforce for Replication = No", but I am not sure why I am still getting this error after reinitializing the subscription and re-running the agent. I have also tried to delete the subscription and publication after making that change and it still doesn't seem to make a difference. Does anyone have any suggestions?

  • not sure if this will resolve your error 547 but it did mine just now.

    my publisher and subscriber table had no records. so upon initializing the snapshot I was getting the error. i added a dummy record on my publisher table, reinitialized the publication and viola...

    i have no clue why this worked.:w00t:

  • Thanks Rich. I actually found in my case that there was another constraint on that table. When I marked it to not enforce on replication, then reinitialized my subscription it worked. Thanks for your response though.

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

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