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



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q248454
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.

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 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0

For more information, contact your primary support provider.

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.

Modification Type:MajorLast Reviewed:3/14/2006
Keywords:kbHotfixServer kbQFE kbBug kbfix KB248454