Consultor Eletrônico



Kbase P177211: The milliseconds on the datetime field is being rounded off when creating records on MS SQL Server u
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/12/2010
Status: Unverified

SYMPTOM(s):

The milliseconds on the datetime field is being rounded off when creating records on MS SQL Server using MS SQL Server DataServer

Assigning the following on the MS SQL Server will cause the milliseconds to round off to .100:

DATETIME("11/11/2010 13:26:20.099") from ABL is assigned as "2010-11-11 13:26:20.1000000" on the MS SQL Server.

The SQL profiler shows the following for the above assign of datetime data:

exec sp_execute 1,'test1 ','2010-11-11 13:26:20.1000000',0

The milliseconds of .999 will rounds off to next second, and .009 rounds off to .010.

The datetime assignment work fine against OE 10 database.

FACT(s) (Environment):

Windows
MS SQL DataServer
OpenEdge 10.1C01 Service Pack
OpenEdge 10.2x

CAUSE:

SQL Server stores DATETIME with a precision of 3.33 milliseconds (0. 00333 seconds). Similarly, SMALLDATETIME is rounded to the nearest minute. For higher precision the you may want to use DATETIME2 datatype introduced in MS SQL Server 2008 with OE10.2B using SANC10 driver.

FIX:

This is expected behavior from MS SQL Server.