FIX: "Failed to generate dynamic snapshot" when you call sp_MScreatemergedynamicsnapshot in SQL Server

Applies to: SQL Server 2008 Service Pack 3SQL Server 2008 EnterpriseSQL Server 2008 Developer More

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

Cumulative Update 11 for SQL Server 2012 SP1

Cumulative Update 1 for SQL Server 2012 SP2

Cumulative Update 13 for SQL Server 2008 R2 SP2

Cumulative Update 17 for SQL Server 2008 SP3

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:Note 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.