sp_mergemetadataretentioncleanup fails after installing SQL 2012 SP2
Unfortunately we discovered the fix for this problem was not included in SQL Server 2012 SP2 CU1 or CU2. We anticipate the fix will be included in the next cumulative update for SQL Server 2012.
We’re testing the work around below, so far no issues.
————————————————————————
— STOP all Merge Replication synchronizations
— Execute on Published and all Subscriber databases
if exists (select * from sys.columns sc inner join sys.types st on sc.system_type_id = st.system_type_id where object_id = object_id('dbo.sysmergesubscriptions') and sc.name = 'last_local_recgen' and st.name = 'uniqueidentifier') begin alter table dbo.sysmergesubscriptions drop column last_local_recgen alter table dbo.sysmergesubscriptions add last_local_recgen bigint null end ------------------------------------------------------------------------
We’ll post more in the following technical paper:
2982019 FIX: Error when you restart the Merge Agent after you upgrade the Publisher to SQL Server 2012 SP2
http://support.microsoft.com/kb/2982019/EN-US
SYMPTOMS
Assume that you use merge replication that the Publisher is running on Microsoft SQL Server 2012 or SQL Server 2012 Service Pack 1 (SP1). After you upgrade the Publisher to SQL Server 2012 Service Pack 2 (SP2), you cannot restart the Merge Agent. Additionally, you receive the following error:
The merge process could not perform retention-based metadata cleanup in database ‘MergePub’. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
When you execute the sp_mergemetadataretentioncleanup stored procedure manually on the Publisher, the stored procedure fails and you receive the following error:
Source: Merge Replication Provider Number: -2147199466 Message: The merge process could not perform retention-based metadata cleanup in database '<db name>'. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. Msg 206, Level 16, State 2, Procedure sp_mergemetadataretentioncleanup, Line 63 Operand type clash: bigint is incompatible with uniqueidentifier Msg 206, Level 16, State 2, Procedure sp_mergemetadataretentioncleanup, Line 65 Operand type clash: int is incompatible with uniqueidentifier
RESOLUTION
The issue was first fixed in the following cumulative update of SQL Server.
Cumulative Update 1 for SQL Server 2012 SP2
Does this some bug affect SQL Server 2014, and if so which builds does it affect / in which build is it fixed?
Thanks
So the resoluton in the KB is wrong?