The Bulk Insert task provides the quickest way to copy large amounts of data into a Microsoft® SQL Server™ table or view. To ensure high-speed data movement, transformations cannot be performed on the data while it is moved from the source file to the table or view.
For example, suppose your company keeps your million-row product list on a mainframe system. Your e-commerce system uses SQL Server 2000 to populate Web pages. You need to update the product table nightly with the master product list from the mainframe. To do this, you save the product list in a tab-delimited format and use the Bulk Insert task to copy the data directly into the SQL Server table. The table is now refreshed with the updated product data.
The Bulk Insert task encapsulates a Transact-SQL BULK INSERT statement that is run during task execution. In Data Transformation Services (DTS) Designer, you can set parameters for the BULK INSERT statement in the Bulk Insert Properties dialog box. Any BULK INSERT parameters not available graphically are set to their defaults. If you need to set parameters that are not available graphically, you can use the BulkInsertTask object or the bcp utility to set them programmatically.
If a batch size is not set, then an entire bulk copy operation is considered one transaction. If a batch size is set, then each batch constitutes a transaction that is committed when the batch finishes.
The behavior of the Bulk Insert task depends on whether the task is joined into the package transaction. If the Bulk Insert task does not join the package transaction, each error-free batch is committed, as a unit, before the next batch is attempted. If the Bulk Insert task joins the package transaction, error-free batches remain in the transaction at the conclusion of the task. These batches are subject to the commit or rollback operation of the step or package.
A failure in the Bulk Insert task does not automatically roll back successfully loaded batches; task success does not automatically commit them. Commit and rollback operations happen only in response to package and workflow property settings. For more information, see DTS Transaction Fundamentals.
Before using the Bulk Insert task, consider the following:
When specifying the path of the text source file, consider the following:
To optimize performance, consider the following:
To add the Bulk Insert task to a DTS package