Bulk Loading for ODBC

The BULKLOAD= LIBNAME option calls the Bulk Copy (BCP) facility, which lets you efficiently insert rows of data into a DBMS table as a unit. BCP= is an alias for this option.

Windows Specifics: The Bulk Copy facility is available only when you are accessing Microsoft SQL Server data on Windows platforms. To use this facility, your installation of Microsoft SQL Server must include the ODBCBCP.DLL file. BULKCOPY= is not available on UNIX.

As the ODBC interface sends rows of data to the Bulk Copy facility, data is written to an input buffer. When you send all rows or when the buffer reaches a certain size (DBCOMMIT= determines this), all rows are inserted as a unit into the table and the data is committed to the table. You can also set DBCOMMIT= to commit rows after a specified number of rows are inserted.

If you are loading character data that is 8,000 characters or longer, it is recommended that you set the value for the INSERTBUFF= LIBNAME option or the INSERTBUFF= data set option. When using INSERTBUFF=, do not also set BULKLOAD=YES. For more information, see INSERTBUFF= LIBNAME Statement Option.

If an error occurs, a message is written to the SAS log, and any rows that were inserted before the error are rolled back.

Last updated: February 3, 2026