Skip to Content.
Sympa Menu

freetds - Re: [freetds] freebcp row termination not working on freebcp into MSSQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Pickett, David" <David.Pickett AT phlx.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freebcp row termination not working on freebcp into MSSQL
  • Date: Wed, 2 Nov 2005 12:14:24 -0500

Brian,

That sounds like a bug, or at least, since it must work better for others to
have made it to a distribution, a strange behavior for some config or build
glitch. You might try exporting TDSVER to different versions. I am not yet
a freeTDS developer, but just for fun, try it in native (no -c) mode.

BTW, what platform are you running from, and is it a local make?

Best regards,

David

-----Original Message-----
From: bpollard AT micron.com [mailto:bpollard AT micron.com]
Sent: Wednesday, November 02, 2005 12:03 PM
To: freetds AT lists.ibiblio.org
Subject: Re: [freetds] freebcp row termination not working on freebcp
into MSSQL


Thanks David and team, today is a new day and with your insight I have
reattempted to bcp in with freebcp into MSSQL 2000.

I examined my input file and confirmed the \t filed terminator and the
\r row terminator. I was even able to bcp out a simple 2 integer test
file from a simple 2 column table using the freebcp build, but the
native row terminator is not being detected causing the similar bcp in
to fail for row length errors. Furthermore, no error file is created
with the -e switch. I think I have to be close but do not know what
next to try.

$ /mu/sdk/freetds/prod/bin/freebcp temp_bcp..test out /var/tmp/test2.out
-c -U$my_user -P$my_pwd -SBOMSSDEVL>

Starting copy...

3 rows copied.

$ od -c test2.out
0000000 9 \t 9 \n 8 \t 8 \n 7 \t 7 \n
0000014

$ /mu/sdk/freetds/prod/bin/freebcp temp_bcp..test in /var/tmp/test2.out
-c -U$my_user -P$my_pwd -SBOMSSDEVL1>

Starting copy...

Msg 4803, Level 16, State 1
Server 'NTSQL12\BOMSSDEVL19', Line 1
Received invalid row length 512 from bcp client. Maximum row
size is 51.
Msg 20018, Level 5
General SQL Server error: Check messages from the SQL Server.

bcp copy in failed

Brian D. Pollard
Database Systems Administration Team Lead
Micron Technology, Inc. Boise, Idaho
208-368-5437 (voice)
208-368-5000 enter #7073629 (pager)
208-363-4114 (fax)


-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Pickett, David
Sent: Wednesday, November 02, 2005 8:39 AM
To: 'FreeTDS Development Group'
Subject: Re: [freetds] freebcp row termination not working on freebcp
into MSSQL

Brian,

If it follows the Sybase bcp, the \n is the default. Note that in the
shell, you must double barefoot backslashes of control character
metastrings:

http://manuals.sybase.com/onlinebooks/group-as/asg1250e/util/@ebt-link;p
t=18
06?target=%25N%15_10086_START_RESTART_N%25

-c

performs the copy operation with char datatype as the default storage
type
of all columns in the data file. Use this format if you are sharing data
between platforms. This parameter does not prompt for each field; it
uses
char as the default storage type, no prefixes,

\t
(tab) as the default field terminator, and
\n
(new line) as the default row terminator

Best regards,

David

-----Original Message-----
From: Thompson, Bill D (London) [mailto:bill_d_thompson AT ml.com]
Sent: Wednesday, November 02, 2005 8:13 AM
To: FreeTDS Development Group
Subject: Re: [freetds] freebcp row termination not working on freebcp
into MSSQL


It should work with just the -c option, regardless of the version.
take a look at your data file, using 'od' perhaps, to see what's
*really* terminating the row.

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
bpollard AT micron.com
Sent: 02 November 2005 00:13
To: freetds AT lists.ibiblio.org
Subject: [freetds] freebcp row termination not working on freebcp into
MSSQL



> My freebcp -v is
> freebcp version $Id: freebcp.c,v 1.34.2.1 2005/02/03 09:39:14 freddy77
> Exp $
>
> Error I get with this command (it does not delimit my rows naturally
> with carriage return or when I designate -r \n:
>
> freebcp temp_bcp..seg_threshold_stats_bcp in /var/tmp/audit_thresh.bcp
> -c -b 10 -U$my_user -P$my_pwd -SBOMSSDEVL19:1433
>
> Starting copy...
>
> Msg 4803, Level 16, State 1
> Server 'NTSQL12\BOMSSDEVL19', Line 1
> Received invalid row length 30976 from bcp client. Maximum row
> size is 479.
> Msg 20018, Level 5
> General SQL Server error: Check messages from the SQL Server.
>
> -Brian
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy,
retain
or redistribute it. Click here for important additional terms relating
to
this e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds



  • Re: [freetds] freebcp row termination not working on freebcp into MSSQL, Pickett, David, 11/02/2005

Archive powered by MHonArc 2.6.24.

Top of Page