Delen via


Bulk Copying Text and Image Data

Large text, ntext, and image values are bulk copied using the bcp_moretext function. You code bcp_bind for the text, ntext, or image column with a pData pointer set to NULL indicating the data will be provided with bcp_moretext. It is important to specify the exact length of data supplied for each text, ntext,or image column in each bulk-copied row. If the length of the data for a column is different from the column length specified in bcp_bind, use bcp_collen to set the length to the proper value. A bcp_sendrow sends all the non-text, non-ntext, and non-image data; you then call bcp_moretext to send the text, ntext, or image data in separate units. Bulk copy functions determine that all data has been sent for the current text, ntext, or image column when the sum of the lengths of data sent through bcp_moretext equals the length specified in the latest bcp_collen or bcp_bind.

bcp_moretext has no parameter to identify a column. When there are multiple text, ntext, or image columns in a row, bcp_moretext operates on the text, ntext, or image columns starting with the column having the lowest ordinal number and proceeding to the column with the highest ordinal number. bcp_moretext goes from one column to the next when the sum of the lengths of data sent equals the length specified in the latest bcp_collen or bcp_bind for the current column.