FIX: Access Violation May Occur with BCP when Skipping a Column from Input Data File

ID: Q248454


The information in this article applies to:
  • Microsoft SQL Server version 7.0

BUG #: 54557 (SQLBUG_70)

SYMPTOMS

An access violation may occur in the ODBC SQL Server driver if an application attempts to skip a column from the input data file using the bcp_colfmt() function.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next SQL Server service pack that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The English version of this fix should have the following file attributes or later:


   File name     Size   Date        Version 
   -------------------------------------------

   odbcbcp.dll    25KB  12/11/99    3.70.0760
   sqlsrv32.dll  505KB  12/11/99    3.70.0760
 
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.


WORKAROUND

Extract out any column you need to skip from the input data file before bulk copying into the database.


STATUS

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


MORE INFORMATION

As defined by the SQL 7.0 Books Online (BOL) the bcp_colfmt() function allows a value of 0 for the idxServerCol parameter. SQL BOL states:

If this value is 0, bulk copy ignores the column in the data file.
The BCP.exe utility that ships with SQL 7.0 uses the bcp_colfmt() function when a user specifies that a column is to be skipped through a "format file". A user can set the server column number field in the format file (the sixth field) to 0 to specify that a column is to be skipped from the input data file. For more information about BCP.exe, see SQL 7.0 Books Online.

Additional query words:

Keywords : kbbug7.00 kbSQLServ700bug
Version : winnt:7.0
Platform : winnt
Issue type : kbbug


Last Reviewed: December 30, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.