Your observations are consistent the SQL Server Books Online documentation
regarding the datetime data type:
<Excerpt href="tsqlref.chm::/ts_da-db_9xut.htm">
Date and time data from January 1, 1753 through December 31, 9999, to an
accuracy of one three-hundredth of a second (equivalent to 3.33 milliseconds
or 0.00333 seconds). Values are rounded to increments of .000, .003, or .007
seconds, as shown in the table.
Example Rounded example
01/01/98 23:59:59.999 1998-01-02 00:00:00.000
01/01/98 23:59:59.995,
01/01/98 23:59:59.996,
01/01/98 23:59:59.997, or
01/01/98 23:59:59.998 1998-01-01 23:59:59.997
01/01/98 23:59:59.992,
01/01/98 23:59:59.993,
01/01/98 23:59:59.994 1998-01-01 23:59:59.993
01/01/98 23:59:59.990 or
01/01/98 23:59:59.991 1998-01-01 23:59:59.990
</Excerpt>
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Roberto Nenni" <no****@nospam.net> wrote in message
news:42********************@news.tiscali.it...
hi all and sorry for my english
I write into a SqlServer2000 database via jdbc using a PreparedStatement
(pstmt) and one of fields is a TimeStamp, my code is:
qwdum=System.currentTimeMillis();
pstmt.setTimestamp(8 , new Timestamp(qwdum));
sometimes the field on table is correct (the milliseconds are the same of
last 3 digits of variable qwdum), other times it has a difference of 1 o 2
milliseconds
the same code with jdbc Oracle or iSeries works fine
any idea?
thanks
Roberto Nenni