Invalid column name in last_local_recgen in Merge Agent Vs sp_vupgrade_replication

In one of my replication environment i got the below error in Merge agent on a Merge publication.
The error message showing as "Invalid column name showing as last_local_recgen"



This error occurs in my environment after we upgrade SQL Server environment from SQL Server 2014 SP1 to SQL Server 2014 SP2. 
And whatever the Merge publications are already configured in this environment all those Merge publications went into error mode.

We followed the below steps to resolve this issue.

Work Around:
1) Capture .mdf and .ldf of all the user and system databases.
2) Take the backup of all user databases along with system databases including distribution database
3) Take backup of all the publication by generating script for those(Right click on publication -->Generate script)
4) Next run the below command
USE master
GO
EXEC sp_configure 'allow updates',1
RECONFIGURE WITH OVERRIDE

5) Run the below system stored procedure in the master databases.

USE master
GO
EXEC sp_vupgrade_replication
5) No need to provide any input parameter values to this simply run
6) It will modify all the subscription properties information in all the databases. Now you can see the message like below
"Upgrading publication settings and system objects in database"
7) After running this also you can see the errors. Don't frustrate here. Just run the MergeAgent job manually in all the publications. After that issue will get resolve.
8) No need of stop and restarting the services. And no need to do the same in Subscriber server also.




Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server