One of my transaction replication started to throw error:
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_Name". The conflict occurred in database "Database", table "dbo.table", column 'ID'. (Source: MSSQLServer, Error number: 547)
I have dropped the foreign key
constraint from both the publisher and the subscriber, created a new snapshot and reinitialized the replication, but I still getting the same error.
After some searches I found that there are three tables, created by the replication (on the subscriber):
dbo.MSsavedforeignkeys
dbo.MSsavedforeignkeycolumns
dbo.MSsavedforeignkeyextendedproperties
and it two of those table, I saw rows with reference to the deleted FK
.
I delete the rows from those tables but I still get the errors.
Any idea how to fix this?