Export (0) Print
Expand All

SqlBulkCopy.SqlBulkCopy(SqlConnection, SqlBulkCopyOptions, SqlTransaction) Constructor

Initializes a new instance of the SqlBulkCopy class using the supplied existing open instance of SqlConnection. The SqlBulkCopy instance behaves according to options supplied in the copyOptions parameter. If a non-null SqlTransaction is supplied, the copy operations will be performed within that transaction.

Namespace: System.Data.SqlClient
Assembly: System.Data (in system.data.dll)

public SqlBulkCopy (
	SqlConnection connection,
	SqlBulkCopyOptions copyOptions,
	SqlTransaction externalTransaction
)
public SqlBulkCopy (
	SqlConnection connection, 
	SqlBulkCopyOptions copyOptions, 
	SqlTransaction externalTransaction
)
public function SqlBulkCopy (
	connection : SqlConnection, 
	copyOptions : SqlBulkCopyOptions, 
	externalTransaction : SqlTransaction
)
Not applicable.

Parameters

connection

The already open SqlConnection instance that will be used to perform the bulk copy.

copyOptions

A combination of values from the SqlBulkCopyOptions enumeration that determines which data source rows are copied to the destination table.

externalTransaction

An existing SqlTransaction instance under which the bulk copy will occur.

If options include UseInternalTransaction and the externalTransaction argument is not null, an InvalidArgumentException is thrown.

For examples demonstrating how to use SqlBulkCopy in a transaction, see Performing a Bulk Copy Operation in a Transaction.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft