Re: What's new list in FreeTDS 0.91 and 0.92

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Mon, 9 May 2011 10:17:16 -0400
Raymond R Rankins <[email protected]> wrote:

> Exporting of DATE columns seems to work fine, but when importing into
> a DATE column, I'm getting the "Msg 20049, Level 4 Data conversion
> resulted in overflow" error.

The upcoming release 0.91 will not support DATE or other types
introduced in SQL Server 2008.  Support for these data types will take
some time, probably the rest of this year at least unless someone
contributes a patch.  

Reading DATE "works" because the server converts DATE to varchar
(20) for clients using anything less than TDS Version 7.3.  A BCP
upload requires the client to send DATE data in its binary 3-byte
format (days since 0001-01-01).  Prior to TDS 7.3 no such type was
defined.  If sent to a server using, say, TDS 7.2, the server would
probably reject the packet and disconnect the session, even if the
server supports TDS 7.3 and *could* recognize the datatype.  

Give Microsoft credit for backwards compatibility.  At the same time,
recognize that "protocol versions" are not as flexible as feature
negotiation.  To support DATE, we have to implement the whole of TDS
7.3.  We can't indicate to the server we'd like 7.2 with DATEs.  

To support just DATE, we need inter alia:

1.  convert DATE <-> varchar
2.  convert DATE <-> DATETIME
3.  convert DATE <-> SMALLDATETIME
4.  support e.g. db_bind for DATE
5.  add DATE to the conversion unit test

I took an initial step today to support a TDS 7.3 login packet.  Once
we can log in, the server will start sending and receiving DATE in its
native form, and the work listed above can commence.  Before the next
release, all 7.3 datatypes will need to be supported.  Frediano is even
headed to MARS.  (MARS, though, *is* a negotiable protocol
feature; you can be a 7.3 client with or without MARS support.)  

So many features, so little time.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.