Monday, June 29, 2015

Generate Publication Stored Procedure in SQL Server 2014

In Transaction Replication at times the Subscription Stored Procedures (inset, update or deleted) get out of sync with Publication. 
To get around that problem you need to generate the script of Publication Stored Procedure. 
And execute (alter) them on Subscription Databases. 

First You need to update the output limit of you SQL Server Management Studio. 
As follow : 

Secondly , Change the output to Text as follow : 

Then Execute the stored procedure on your published databases and copy the output and execute it on your subscriber database.

use PublicationDB

EXEC sp_scriptpublicationcustomprocs 'PublicationName'

There is also a utility by Code Project : here

No comments: