I have an application at a client site that has been deployed for almost 5 months. Things have been running fairly smoothly. The database uses merge replication to replicate data to remote clients via web sync. There are several publications, one subscription for each publication.
Last week, we deleted one of the publications.
This seems to have corrupted the table triggers that handle replication.
For example, the Headers table contains 3 triggers:
MSmerge_del_33E1341A8E1445F1BA4A9AE3453AD4EC
MSmerge_ins_33E1341A8E1445F1BA4A9AE3453AD4EC
MSmerge_upd_33E1341A8E1445F1BA4A9AE3453AD4EC
Now, whenever we attempt to update, insert, or delete a header record, we get the following error message:
Msg 208, Level 16, State 1, Procedure MSmerge_upd_33E1341A8E1445F1BA4A9AE3453AD4EC, Line 21533
Invalid object name 'dbo.MSmerge_repl_view_C46DF051E0C5498DA208189F1580448D_5F186CBD964D48C497A87B98789D0114'.
I have determined that C46DF051E0C5498DA208189F1580448D is the publication ID of the deleted publication.
Apparently this problem exists on every replication-related trigger on every table in the database. For example, if I attempt to update the Addresses table, I get a similar error message.
My question: Is there a way to have SQL Server "regenerate" all the triggers on all the tables? I assume there must be a stored procedure somewhere to do this, since stored procedures are what create the replication triggers to begin with.
Any feedback appreciated, we're sort of dead in the water here, since we can't process updates on the central server at this time.