FIX: Bcp.exe ignores -R regional settings switch when using format file (-f) (292648)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q292648

SYMPTOMS

The Bcp.exe -R regional settings switch is ignored when using a bulk copy program (BCP) format file. The switch works properly when using a character mode BCP input file with the -c character mode parameter.

CAUSE

Bcp.exe ignores the -R settings when the -f (format file) is specified.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next SQL Server 2000 Service Pack 1 that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Date         Time      Version        Size          File name    Platform
-------------------------------------------------------------------------
22-JAN-2001  15:11:10  2000.80.246.0  94,208 bytes  Bcp.exe      x86
22-JAN-2001  15:11:36  2000.80.246.0  16,384 bytes  Bcp.rll      x86
				

STATUS

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

MORE INFORMATION

Steps to reproduce behavior

  1. Change the regional settings to English (United Kingdom).
  2. Connect to the SQL Server with Query Analyzer and issue the following command:
    CREATE TABLE dbo.TEST (FEE_DATE smalldatetime NULL)
    					
  3. Create a BCP file named TEST.bcp with the value 16/07/1999.
  4. Create a format file named TEST.fmt with the following values:
    4.2
    1
    1       SYBCHAR       0       10      ""        1       FEE_DATE
    					
  5. Issue the following command:
    bcp DATABASE_NAME..TEST in c:\temp\test.bcp -fc:\temp\test.fmt -ec:\temp\error.txt -ServerName -Usa  -Ppassword -R
    					
The output is as follows:
** Fails with
Starting copy...
SQLState = 22008, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Invalid date format
0 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.): total       10
				

Modification Type:MinorLast Reviewed:10/12/2005
Keywords:kbHotfixServer kbQFE kbBug kbprb kbQFE kbSQLServ2000sp1fix KB292648