[teiid-users] sql server time column
Steven Hawkins
shawkins at redhat.com
Thu Jul 23 10:09:22 EDT 2009
Several changes in Teiid have made our old behavior of allowing users to mark datatime columns from SQL Server/Sybase as time type in Teiid not work (it used to only fail in some situations with prepared statements). The issue is that SQL Server treats the default year for a time value as 1900 instead of 1970.
My preferred approach is to have users represent the source datetime as a timestamp in Teiid (which is the default upon import), but perform type reconciliation in a virtual model using the following expression - convert(timestampadd(SQL_TSI_YEAR, 70, <source datatime>), time).
To ensure this doesn't harm performance I can add a rewrite rule to perform the inversion of timestampadd.
Since it includes the time type, this isn't an issue with SQL Server 2008.
Steve
More information about the teiid-users
mailing list