BUG: Bcp_exec Causes AV If Bcp_columns Is Less Than Table ColumnsID: Q199214
|
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.
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.
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.
Microsoft has confirmed this to be a problem in SQL Server version 6.0, 6.5, and 7.0.
This problem only affects BCP OUT operations, not BCP IN.
Additional query words: terminate terminates terminated bcped bcping
Keywords : kbbug6.50 kbbug6.0 kbbug7.00
Version : winnt:6.0,6.5,7.0
Platform : winnt
Issue type : kbbug
Last Reviewed: February 12, 1999