BUG: DTS May Transfer the Unnecessary Lead Byte of a Double-Byte Character (301382)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q301382
BUG #:101191 (SQLBUG_70)

SYMPTOMS

Data Transformation Services (DTS) may transfer the unnecessary lead byte of a double-byte character (DBCS) when the following conditions are met:
  • You use Microsoft OLE DB Provider for SQL Server to connect to the destination server.
  • The column is a character data type (varchar or char).
  • The import data is truncated to fit into the column.

WORKAROUND

Use the Microsoft ODBC Driver for SQL Server to connect to destination server.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0.

MORE INFORMATION

Steps to Reproduce Behavior

You can use the following steps to demonstrate the truncation:
  1. Add codepage932 (Japanese) from the Microsoft Windows NT LangPack folder. Or, you can use the Microsoft Windows Japanese NT version.
  2. Install Microsoft SQL Server or rebuild the master database as cp932 with a binary sort order.
  3. Execute the following queries:
    create table t1 (c1 int, c2 char(4))
    go
    create table t2 (c1 int, c2 char(3))
    go
    insert into t1 values ( 1, 0x82A082A0)
    go
    					
  4. Execute the DTS Export/Import Wizard with following option:

    Destination : Microsoft OLE DB Provider for SQL Server
    Table Copy or query : Use a query to specify the data to transfer
    SQL query statement : SELECT c1,c2 FROM t1
    Destination table name : t2
    Run DTS package immediately : Yes

  5. Execute the following query:
    select convert(binary,c2) from t2 where c1 = 1
    go
    					
    The result that is returned is:
    c2 
    ------ 
    0x82A082000000000000000000000000000000000000000000000000000000 
    					
    Use the Microsoft ODBC Driver for SQL Server. The result that is returned is:
    c2 
    ------ 
    0x82A000000000000000000000000000000000000000000000000000000000
    					

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbDSupport KB301382