Re: Milliseconds to SQL Server DateTime
- From: Jouni Aro <jouni.aro@xxxxxxxxx>
- Date: Fri, 23 Nov 2007 11:27:58 +0200
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?
.
- References:
- Milliseconds to SQL Server DateTime
- From: Jouni Aro
- Re: Milliseconds to SQL Server DateTime
- From: Helmut Woess
- Milliseconds to SQL Server DateTime
- Prev by Date: Re: Milliseconds to SQL Server DateTime
- Next by Date: Closed DataSet
- Previous by thread: Re: Milliseconds to SQL Server DateTime
- Next by thread: Re: Milliseconds to SQL Server DateTime
- Index(es):
Relevant Pages
|