Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Bug with new release candidate, 'freebcp in', and date format
  • Date: Fri, 8 May 2015 19:16:37 +0100

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




Archive powered by MHonArc 2.6.24.

Top of Page