[egenix-users] "right truncation" warning in mx.ODBC.Windows

Charles Bearden Charles.F.Bearden at uth.tmc.edu
Thu Mar 11 11:31:57 CET 2004


> -----Original Message-----
> From: egenix-users-bounces at lists.egenix.com [mailto:egenix-users-
> bounces at lists.egenix.com] On Behalf Of Steve Holden
> Sent: Thursday, March 11, 2004 9:40 AM
> 
> [mal]
> > Steve Holden wrote:
> > > [mal]
> > >
> > >>>datestmp = mx.DateTime.localtime(time.time())
> > >>
> > >>Try to use a string here: '2004-03-11 10:00:00' and
> > >>see whether that makes any difference (the ODBC driver could
> > >>be having trouble with the seconds fraction - even though
> > >>we've never heard of such problems with SQL Server before).
> > >
> > > I'm sorry, I thought this was well-known (and I also thought I had
> > > reported it earlier. Maybe I invented that last piece of
> > knowledge :-).
> >
> > Probably just dropped off my horizon: looking at the list
> > archives, you are right. I wonder whether this only affects
> > certain versions of the MS ODBC driver ?!
> >
> Well, good to know I *didn't* invent the report!
> 
> > If so, please provide us with the information from
> >
> > connection.dbms_version
> > connection.dbms_name
> > connection.driver_name
> > connection.driver_version
> >
> Are these connection attributes a recent addition? My 2.0.5 doesn't
have
> them, nor any reference to them in the documentation. Or have I
> misunderstood what I'm supposed to be reporting?
> 
> Anyway, from the ODBC driver info applet:
> 
> SQL Server; Version 2000.80.194.00; SQLSRV32.DLL; 8/6/2000
> 
> Frankly I'm amazed that Windows Update hasn't provided me with
something
> more recent. However, investigation reveals (amazingly) that I only
have
> the hot fixes. [... upgrades to sp3a ... aagghh, I hate service packs
> ... 1 hour later ...]  OK, now my driver is
> 
> SQL Server; Version 2000.81.9031.38; SQLSRV32.DLL; 3/11/2003
> 
> but sadly this doesn't seem to be any better:
> 
> Trying 2004-03-11 10:29:20.86
> Oops! We trod on the driver!
> ["Warning: ('01004', 0, '[Microsoft][ODBC SQL Server Driver]Fractional
> truncation', 4579)\n"]
> Trying 2004-03-11 10:29:20.00
> That seemed to work
> 
> Maybe there's some option setting that will automatically truncate
> fractional seconds, and I don't have it set? Can't find anything in
the
> documentation, though. FWIW, Transact-SQL docco says """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.""", so it should be capable of
> sub-second resolution. Perhaps it just doesn't like values that
require
> rounding?
> 
> > We can then look into adding code to truncate the fraction in
> > timestamps for MS SQL Server ODBC drivers.
> >
> Well OK, I hope this helps.

Thank you M.-A. and Steve for your responses.  I tried Steve's
suggestion of using the DateTimeFromTicks method and it seems to work.

> If so, please provide us with the information from

> connection.dbms_version
> connection.dbms_name
> connection.driver_name
> connection.driver_version

Like Steve, I couldn't find these attributes in the module.

My MS SQL driver is newer than Steve's:

  SQL Server; Version 2000.81.9042.00; SQLSRV32.DLL; 10/27/2003

Thanks again for your replies.  Let me know if I should check anything
else on my setup.

Chuck Bearden



More information about the egenix-users mailing list