Symptoms
Assume that you have Microsoft SQL Server 2008 Service Pack 3 (SP3), SQL Server 2008 R2 Service Pack 2 (SP2), SQL Server 2012 Service Pack 2 (SP2), SQL Server 2012 Service Pack 1(SP1), or SQL Server 2014 installed on a computer. When you call the sp_MScreatemergedynamicsnapshot stored procedure to create a dynamic snapshot, you receive the following error messages:
Msg 8115, Level 16, State 2, Procedure sp_MScreatemergedynamicsnapshot, Line 182
Arithmetic overflow error converting expression to data type nvarchar. Msg 20655, Level 16, State 1, Procedure sp_MScreatemergedynamicsnapshot, Line 186 The partitioned snapshot process cannot complete. Cannot retrieve the maximum timestamp information from the MSsnapshot_history table in the distribution database. Ensure that a standard snapshot is up-to-date and available. Msg 20628, Level 16, State 1, Procedure sp_MScreatemergedynamicsnapshot, Line 203 Failed to generate dynamic snapshot.Note This issue occurs when the agent_id value exceeds 99,999 in the MSdynamicsnapshotjobs table.
Cause
This issue occurs because of a defect in SQL Server. The type of the local variable for agent_id is a char, and its length is 5. An arithmetic overflow may occur when SQL Server handles the value that is assigned to INT type.
Resolution
The issue was first fixed in the following cumulative update of SQL Server.
Cumulative Update 3 for SQL Server 2014 /en-us/help/2984923
Cumulative Update 11 for SQL Server 2012 SP1 /en-us/help/2975396
Cumulative Update 1 for SQL Server 2012 SP2 /en-us/help/2976982
Cumulative Update 13 for SQL Server 2008 R2 SP2 /en-us/help/2967540
Cumulative Update 17 for SQL Server 2008 SP3 /en-us/help/2958696
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
Hotfix information
A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem. To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:http://support.microsoft.com/contactus/?ws=supportNote In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.