[freetds] Bug with new release candidate, 'freebcp in', and date format

Frediano Ziglio freddy77 at gmail.com
Fri May 8 14:16:37 EDT 2015


2015-05-08 12:53 GMT+01:00 Ed Avis <eda at waniasset.com>:
> I've found a change in behaviour with date parsing and freebcp.
> Create a global temporary table to copy into:
>
>     > create table ##test (dt date not null, value int not null)
>
> Now make a CSV file and load it in:
>
>     % echo 26-Jul-2000,1 >test.csv
>     % freebcp '##test' in test.csv -S MYSERVER -U mydb -P mypass -c -t ','
>
> The date in the CSV file is misparsed:
>
>     > select * from ##test;
>      dt         value
>      ---------- -----------
>      1900-07-01           1
>
> This is new with 0.95 - it works OK with revision 0a42888.  I didn't see it
> mentioned in the ChangeLog file.
>
> Are these dates being parsed by the server or by freebcp itself?
>

I tried to reproduce the problem with a simple script and worked
really good (mssql 2008 with 7.3 protocol) then I tried with a former
protocol (from 7.0 to 7.2) and server say the column is a NVARCHAR,
then freebcp (correctly) try to send a string to server. The strange
thing is that my server converted the "26-Jun-2000" to 1900-06-01 !!!
I looked at log and server just accept the string and insert that
strange value. Can you check which protocol version are you using?

Frediano


More information about the FreeTDS mailing list