BUG: Bcp_exec Causes AV If Bcp_columns Is Less Than Table Columns (199214)
The information in this article applies to:
- Microsoft SQL Server 6.0
- Microsoft SQL Server 6.5
- Microsoft SQL Server 7.0
This article was previously published under Q199214
BUG #: 53584 (SQLBUG_70)
BUG #: 18490 (SQLBUG_65)
SYMPTOMS
When using the bulk copy program (BCP) application programming interface (API), the bcp_columns function is used to specify the number of columns to be accessed. However, when bulk copying out, if the bcp_columns value is set to less than the actual number of columns in the table or view, the bcp_exec function will experience an exception access violation (AV).
When using the Bcp.exe utility, the application will be shut down abnormally. Custom applications may exhibit different behavior based on implementations of structured exception handling.
CAUSE
BCP API attempts to map the total number of columns from the table to the column format information. If the bcp_columns setting is less than the total number of columns in the table, the memory area holding the format information for the columns is too small, and when accessed, causes the exception error.
WORKAROUND
To work around this problem, create a view containing the exact columns to be bulk copied out and ensure the bcp_columns is called with the same number of columns.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.0, 6.5, and 7.0.
MORE INFORMATION
This problem only affects BCP OUT operations, not BCP IN.
Modification Type: | Major | Last Reviewed: | 11/14/2003 |
---|
Keywords: | kbBug kbpending KB199214 |
---|
|