Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: "System.OverflowException: Value was either too large or too small" error message when you perform data synchronization by using Sync Framework 2.1


Symptoms

When you use Microsoft Sync Framework 2.1 to perform data synchronization, you may receive the following error message:
System.OverflowException: Value was either too large or too small for a UInt64. At System.Int64.
Additionally, when you run the following code against the problematic database to check the @@dbts value, you will find that the value is greater than the limitation of an Integer data type value (2147483647):
select @@dbts
Note @@DBTS returns the last-used time stamp value of the database.

↑ Back to the top


Cause

This issue occurs because Sync Framework performs some calculations on @@dbts after converting the @@dbts value to the Integer data type value. However, when the @dbts value is greater than 2147483647, the value is converted to a negative integer value. Therefore, an OverflowException exception occurs in the later calculations.

↑ Back to the top


Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Installation notes

Install the following Windows Installer packages in the following sequence:
  1. Synchronization-<KB>-v2.1-<arch>-<lang>.msi
  2. ProviderServices-<KB>-v2.1-<arch>-<lang>.msi
  3. DatabaseProviders-<KB>-v3.1-<arch>-<lang>.msi
Note Install the Windows Installer packages only if you have the corresponding components installed on the computer. For example, do not install the ProviderServices-<KB>-v2.1-<arch>-<lang>.msi file if you do not have Sync Framework 2.1 Provider Services installed on the computer.

Prerequisites

To apply this hotfix, you must have Sync Framework 2.1 installed.

Restart requirement

You do not have to restart the computer after you apply this hotfix if affected files are not being used.

Hotfix replacement information

This hotfix does not replace any other hotfix.

File information

The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
File name File version File size Date Time Platform
Microsoft.synchronization.data.sqlserver.dll 3.1.2508.0 280,816 05-May-2012 06:18 x86
Microsoft.synchronization.data.sqlserver.dll 3.1.2508.0 280,816 05-May-2012 06:18 amd64

↑ Back to the top


More Information

The following code uses an illustrative hexadecimal value (0x00000000A0171FB0). When you run the code, you receive a negative integer value:
Declare @TS timestamp 
Set @TS=0x00000000A0171FB0
select @TS +1 ====>>>>>> this gives a negative value: -1609097295
The correct implementation is to cast the @@dbts value to the BIGINT data type value before any calculations:
Declare @TS timestamp 
Set @TS=0x00000000A0171FB0
select convert(bigint,@TS) +1 ====>>>>>> this gives a correct time stamp value

↑ Back to the top


References

For more information about @@dbts, visit the following MSDN website:

↑ Back to the top


Keywords: kbautohotfix, kbqfe, kbhotfixserver, kbfix, kbexpertiseadvanced, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2703853
Revision : 1
Created on : 1/7/2017
Published on : 5/23/2012
Exists online : False
Views : 225