Re: Milliseconds to SQL Server DateTime



Helmut Woess wrote:
Am Thu, 22 Nov 2007 18:11:03 +0200 schrieb Jouni Aro:

I am wondering if it is possible to store timestamps with milliseconds in SQL Server using the ADO components. If yes, how? If no, what do you suggest?

Jouni Aro
Prosys

Yes and No :-)
What i mean: you can store milliseconds, but not exactly, because the
resolution is 3 or 4 milliseconds. For example:
you send this as a string: '2005-08-17T09:20:50.123' (see the 'T' in the
middle!)
and if you read the datetime field you will get 2005-08-17 09:20:50.123
now if you send '2005-08-17T09:20:50.124'
you will still have 2005-08-17 09:20:50.123 in the database
but if you send '2005-08-17T09:20:50.125'
you will find 2005-08-17 09:20:50.127 in the database
That's not an ADO problem, it's because SQL-Server can't store a datetime
more precisely.

Thanks, I also found out something like this. But is the only option to embed the values to the sql statement?

What if I want to use parameters and bind values to those (the normal way) - it seems the milliseconds are cut off?

.



Relevant Pages

  • Re: Migration of Teradata and DB2 Timestamp fields.
    ... There is no datatype in SQL Server that has a precision of 1 millisecond. ... - Store the timestamp in a CHARcolumn in format ... Note that the precision will go back to 3.33 milliseconds when you ...
    (microsoft.public.sqlserver.datawarehouse)
  • Milliseconds to SQL Server DateTime
    ... I am wondering if it is possible to store timestamps with milliseconds in SQL Server using the ADO components. ...
    (borland.public.delphi.database.ado)
  • Re: Newbie help
    ... think I can probably get what I need using SQL Server (the ... > To efficiently store and retrieve data for your needs, ... You only store changed values (as ...
    (microsoft.public.sqlserver.programming)
  • Re: meta data & full text search
    ... There are more issues (transaction control, change control, audit of ... storing the files in a SQL Server table's column defined with an IMAGE ... if you store the files ... consistency of the database, indices, backup, restore, etc. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Access 2000 - Realtime Development - Should i stick with Access97
    ... if I needed to start using SQL Server to store Tables of an Access 97 front ... would this force the need to upgrade. ... > is because you have support clients who are using later versions. ...
    (microsoft.public.access.modulesdaovba)