- changed status to resolved
[PATCH] Adding Time support to MS-SQL
This patch add an engine specific type, MSTime, which use the DATETIME mssql type.
The actually stored value is a datetime with a date set to 1900-01-01, as it's the default date in mssql when only a time is given (cf http://vyaskn.tripod.com/searching_date_time_values.htm).
The concerned unittest (sql.testtypes.DateTest) is also patched in two ways : - the Time type is tested - the tested values are rounded to the nearest 3.33 milliseconds, as it is the precisions of datetime values in MS-SQL.
The unittest DateTest runs successfully on linux with pymssql 0.8.0.
Note that with this patch, querying on Time columns with comparison operators should be ok, but probably not if other operators ('+', '-') are used in the expression. Maybe another patch could fix that, but my skills in SA are not (yet) at the required level.
Regards,
Christophe
Comments (1)
-
repo owner - Log in to comment
comment from ram:
This is a bit of a hack, as MSSQL doesn't really have TIME columns. But, it seems like a harmless one.
Committed in changeset:3050, thanks.