Microsoft KB Archive/323502

= BUG: BCP May Export Corrupted DBCS Characters That Are Stored In a Char or Varchar Data Type =

Article ID: 323502

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q323502



BUG #: 356458 (SHILOH_BUGS)

BUG #: 85675 (MDAC_BUGS)



SYMPTOMS
Double-byte character set (DBCS) characters that are exported by the bcp utility, may contain corrupted data if all of the following conditions are true:  The exported column's data type is char or varchar. The DBCS data stored in the exported column has 1022 bytes, or more, in size.  The -c switch is used. For example: bcp &quot;pubs..test&quot; out out.txt -S. -T -c 



WORKAROUND
To work around this problem, use one of the following methods:   Use the -w switch instead of the -c switch when you run the bcp utility. For example: bcp pubs..test out out.txt -S. -T -w -or-

 Use the nchar or the nvarchar data type instead of a char or a varchar data type for the DBCS columns. -or-

</li> Use the SQL Server 7.0 bcp client.</li></ul>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce the Behavior
Follow these steps to reproduce the behavior: <ol>  Create a new table with a char or a varchar column: use pubs go create table test (col1 varchar(5000)) go </li>  Insert 1024 DBCS characters (2048 bytes) into the table you created in step 1: insert test values(replicate(0x8260, 1024)) go </li>  Run the following bcp command at the command prompt: bcp pubs..test out out.txt -S. -T -c </li></ol>

RESULT: Instead of seeing exactly 1024 characters of 0x8260, some of the characters are corrupted.

Additional query words: DBCS BCP corrupted data export

Keywords: kbbug kbpending KB323502

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.