2012年3月27日星期二

BCP will delete '\' chars on insert of character data

I've discovered that when using BCP to insert character data, then for any s
equence '\' + <newline> (backslash + ASCII 13), the '\' character is strippe
d. For example, try inserting this:
"Hello\\n"
and you'll wind up with
"Hello\n"
Can I turn this behavior off, or is this a known bug in BCP?
I'm using BCP with the SQL Server 7 ODBC driver.
Thanks,
Jim FloodJim Flood wrote:

> I've discovered that when using BCP to insert character data, then for any
sequence '' + <newline> (backslash + ASCII 13), the '' character is strip
ped. For example, try inserting this:
> "Hello\\n"
> and you'll wind up with
> "Hello\n"
> Can I turn this behavior off, or is this a known bug in BCP?
> I'm using BCP with the SQL Server 7 ODBC driver.
> Thanks,
> Jim Flood|||Can you verify the version number of the ODBC driver? You can do this be
running the ODBC Administrator and looking for the Version for the "SQL
Server" driver on the Drivers tab. Or, you can check the version of
sqlsrv32.dll in your system32 directory using Explorer.
We tried this with an 8.0 ODBC Driver and it does not repro. Before I go
setup a machine with SQL 7.0 on it, I want to verify your version number, to
make sure I get the same version.
Brannon Jones
Developer - MDAC
This posting is provided "as is" with no warranties and confers no rights.
"Jim Flood" <anonymous@.discussions.microsoft.com> wrote in message
news:DA87D286-F669-4F74-A5E5-82A9CBDEE5BE@.microsoft.com...
> I've discovered that when using BCP to insert character data, then for any
sequence '' + <newline> (backslash + ASCII 13), the '' character is
stripped. For example, try inserting this:
> "Hello\\n"
> and you'll wind up with
> "Hello\n"
> Can I turn this behavior off, or is this a known bug in BCP?
> I'm using BCP with the SQL Server 7 ODBC driver.
> Thanks,
> Jim Flood|||The version number is 2000.81.9042.0. The sequence is backslash character, f
ollowed by newline character. Backslash followed by any other character does
not cause a problem.

没有评论:

发表评论