You receive an ODBC error when you use BCP in SQL Server 2000 (867677)



The information in this article applies to:

  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Personal Edition

SYMPTOMS

When you use the Bcp.exe (BCP) bulk copy utility in Microsoft SQL Server 2000 to import or to export data, you may receive an error message that is similar to the following:


SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Code page <codepage> is not supported by SQL Server SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC SQL Server Driver]Unable to resolve column level collations BCP copy out failed



Note <codepage> is the code page number that you specified by using the bcp -C argument, or the OEM code page number of your operating system.

CAUSE

This problem can occur if your operating system code page or the code page that is specified in the BCP statement is not one of the following:
  • 437
  • 850
  • 874
  • 932
  • 934
  • 936
  • 949
  • 950
  • 1250 - 1258


This problem occurs if MDAC 2.6, MDAC 2.7, MDAC 2.8, or the version of MDAC that is included with Microsoft SQL Server 2000 is installed on the client computer. The SQL Server ODBC driver in these versions of MDAC incorrectly checks the code page that you specify with the list of code pages that are supported by SQL Server 2000.

WORKAROUND

To work around this problem, use one of the following three methods.

  • Use the -w switch in your BCP statement.

    When you use the -w switch in your BCP statement, the bulk copy operation uses Unicode characters. Using the -w switch is a SQL Server 2000 best practice. The following example uses the -w switch:
    bcp pubs..test out out.txt -S servername -T -w
  • Use a BULK INSERT statement to import data into a SQL Server 2000 table or a view.

    Use a BULK INSERT statement to import data from a file into SQL Server 2000.

    Note You cannot use a BULK INSERT statement to export data to a file from SQL Server 2000.
  • Run the BCP command from a client computer.

    Run the BCP command from a computer that has MDAC 2.1 installed. For example, run the BCP command from a computer that has Microsoft SQL Server 7.0 installed.
Note You cannot work around this issue by temporarily changing your OEM code page number with the Chcp.com (CHCP) utility.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

The OEM code page number for your operating system is stored in the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP

Modification Type:MinorLast Reviewed:1/31/2005
Keywords:kbtshoot kbinfo kbprb KB867677 kbAudITPRO kbAudDeveloper