Page 1 of 1

SDAC does not fully support SQL 2008 datetime2

Posted: Thu 03 Dec 2009 01:26
by Vladimir
The SDAC Delphi DateTime is only accurate to a millisecond.
If a new datetime2(7) column is a part of a key, a record can't be deleted since the DateTime SDAC sends to SQL isn't accurate enough

Here is SDAC trying to delete my Notes record

exec sp_executesql N'DELETE FROM dbo.PurchaseOrderLineNotes
WHERE
pohID = @P1 AND polLineNo = @P2 AND polntID = @P3 AND polnCreatedOn = @P4',N'@P1 int,
@P2 int,@P3 smallint,@P4 datetime2(7)',124,2,2,'2009-12-02 18:00:15.7430000'

And here is the CreatedOn from then record from the Management studio

2009-12-02 18:00:15.7430449

Please support SDAC being fully compliant with datetime2 data type.

Posted: Thu 03 Dec 2009 08:44
by Dimon
This behaviour is connected with the fact that Delphi TDateTime field keeps time only to millisecond, and we can't influence this behaviour.

Delphi/DateTime2

Posted: Tue 02 Nov 2010 16:37
by jpg
Hi,
So really there's no simple solution other than to explicitly state it's a datetime field or use cast/convert