FIX: BCP Out Fails with Exception Error if You Use a Format File to Change Order of Columns
Dec.26, 2011 in
Uncategorized
Symptoms
If you use Bcp.exe to export a table to a flat file, the process may fail with an exception error if you use a format file to change the order of the columns during the export. The exception error occurs within the Bcp.exe file and the following error message appears:
The instruction at “memory_address” referenced memory at “memory_address”.
The memory could not be “written”.The output file is created but no rows are exported.
Resolution
Use a view to change the order of the columns to export. Then, use the view when you perform the bulk copy program and have the format file match the order of the columns in the view.

Leave a Reply