Skip to Content.
Sympa Menu

freetds - RE: [freetds] [ freetds-Patches-1106465 ] quote column names for bcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] [ freetds-Patches-1106465 ] quote column names for bcp
  • Date: Fri, 21 Jan 2005 09:45:32 -0000

Its only in TDS 7.0 (for SQL) that we need to send the table desciption
as part of the bcp init syntax.
So the square brackets are safe.

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of SourceForge.net
Sent: 21 January 2005 07:45
To: noreply AT sourceforge.net
Subject: [freetds] [ freetds-Patches-1106465 ] quote column names for
bcp


Patches item #1106465, was opened at 2005-01-21 04:45
Message generated for change (Comment added) made by freddy77
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=1106465&gro
up_id=33106

Category: db-lib
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Paul Rensing (prensing)
Assigned to: Nobody/Anonymous (nobody)
Summary: quote column names for bcp

Initial Comment:
With TDS version 7.0 and higher, bcp fetches the table
column names and then sends them back to the DB when
setting up the bcp transfer (in the "INSERT BULK"
statement). The problem occurs if you have spaces in
your column names; the column names are not quoted in
any way and the server gets confused.

Turns out (at least on MS SQLserver) that the way to
quote the column names is to use square brackets ("[",
"]"), not quotes. The patch modifies bcp.c to always
quote column names.

I have tested this against our MS SQLServer 2000. I
don't have any other system to test.

----------------------------------------------------------------------

>Comment By: Frediano Ziglio (freddy77)
Date: 2005-01-21 08:44

Message:
Logged In: YES
user_id=75766

The patch it's a bit out dated. Perhaps it would be better
for backport 0.64 code to 0.63. Note that quote are not
compatible with sybase and do not works if column name
contains ']' character.

freddy77

----------------------------------------------------------------------

Comment By: Paul Rensing (prensing)
Date: 2005-01-21 04:47

Message:
Logged In: YES
user_id=32595

Sorry. Forgot to say: the patch was against version 0.62.4.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=1106465&gro
up_id=33106
_______________________________________________
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/
--------------------------------------------------------





Archive powered by MHonArc 2.6.24.

Top of Page