Class AdbSqlClientBulkInsertTargetFactory
Factory methods that create an AdbSqlClientBulkInsertTarget<TInput> dataflow worker, which inserts all incoming records into a SQL Server® table or non-partitioned view using SqlBulkCopy, which achieves high performance by loading records in bulk. Also see SqlBulkCopyColumnOrderHintCollection as well as Optimizing Bulk Import Performance.
Enabling TableLock improves performance significantly, but prohibits any other thread or process to access the table while the bulk copy is running.
Note that this worker requires an AdbSqlClientProvider connection, see SQL Database Access for details.
Note: This worker does participate in any transaction currently active on the connection.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).
Namespace: actionETL.Adb.SqlClientExternal
Assembly: actionETL.dll
Syntax
public static class AdbSqlClientBulkInsertTargetFactory
Methods
AdbSqlClientBulkInsertTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IColumnMapperCommand>, IAdbConnectionBuilder, SqlBulkCopyOptions, String)
Initializes a new instance of the AdbSqlClientBulkInsertTarget<TInput> dataflow worker, which inserts all incoming records into a SQL Server® table or non-partitioned view using SqlBulkCopy, which achieves high performance by loading records in bulk. Also see Optimizing Bulk Import Performance.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static AdbSqlClientBulkInsertTarget<TInput> AdbSqlClientBulkInsertTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Action<IColumnMapperCommand> columnMapperCommandAction, IAdbConnectionBuilder sqlConnectionBuilder, SqlBulkCopyOptions sqlBulkCopyOptions, string compositeTableName)
where TInput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Action<IColumnMapperCommand> | columnMapperCommandAction | Defines mappings between external database columns and output columns. Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see Dataflow Column Mapping. |
| IAdbConnectionBuilder | sqlConnectionBuilder | The connection builder for a SQL Server®. |
| SqlBulkCopyOptions | sqlBulkCopyOptions | SQL bulk copy options. Enabling TableLock improves performance significantly, but prohibits any other thread or process to access the table while the bulk copy is running. |
| String | compositeTableName | Name of the table to insert into. The string must have a format appropriate
for the data source. E.g. for the SqlClient provider: |
Returns
| Type | Description |
|---|---|
| AdbSqlClientBulkInsertTarget<TInput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|