C# Class Rhino.Etl.Core.Operations.SqlBulkInsertOperation

Allows to execute an operation that perform a bulk insert into a sql server database
Inheritance: Rhino.Etl.Core.Operations.AbstractDatabaseOperation
Mostrar archivo Open project: ayende/rhino-etl

Public Properties

Property Type Description
Mappings string>.IDictionary

Public Methods

Method Description
CreateInputSchema ( ) : void

Use the destination Schema and Mappings to create the operations input schema so it can build the adapter for sending to the WriteToServer method.

Execute ( IEnumerable rows ) : IEnumerable

Executes this operation

PrepareMapping ( ) : void

Prepares the mapping for use, by default, it uses the schema mapping. This is the preferred appraoch

Protected Methods

Method Description
IsOptionOn ( SqlBulkCopyOptions option ) : bool

Returns true if the option is turned on, otherwise false

PrepareSchema ( ) : void

Prepares the schema of the target table

SqlBulkInsertOperation ( ConnectionStringSettings connectionStringSettings, string targetTable ) : System

Initializes a new instance of the SqlBulkInsertOperation class.

SqlBulkInsertOperation ( ConnectionStringSettings connectionStringSettings, string targetTable, int timeout ) : System

Initializes a new instance of the SqlBulkInsertOperation class.

SqlBulkInsertOperation ( string connectionStringName, string targetTable ) : System

Initializes a new instance of the SqlBulkInsertOperation class.

SqlBulkInsertOperation ( string connectionStringName, string targetTable, int timeout ) : System

Initializes a new instance of the SqlBulkInsertOperation class.

ToggleOption ( SqlBulkCopyOptions option, bool on ) : void

Turns a bulkCopyOptions on or off depending on the value of on

TurnOptionOff ( SqlBulkCopyOptions option ) : void

Turns the option off.

TurnOptionOn ( SqlBulkCopyOptions option ) : void

Turns the option on.

onSqlRowsCopied ( object sender, System.Data.SqlClient.SqlRowsCopiedEventArgs e ) : void

Handle sql notifications

Private Methods

Method Description
CompareSqlColumns ( SqlConnection connection, SqlTransaction transaction, IEnumerable rows ) : void
CreateSqlBulkCopy ( SqlConnection connection, SqlTransaction transaction ) : System.Data.SqlClient.SqlBulkCopy

Creates the SQL bulk copy instance

GetFriendlyName ( Type type ) : string
TypesMatch ( Type schemaType, Type databaseType, bool isNullable ) : bool

Method Details

CreateInputSchema() public method

Use the destination Schema and Mappings to create the operations input schema so it can build the adapter for sending to the WriteToServer method.
public CreateInputSchema ( ) : void
return void

Execute() public method

Executes this operation
public Execute ( IEnumerable rows ) : IEnumerable
rows IEnumerable
return IEnumerable

IsOptionOn() protected method

Returns true if the option is turned on, otherwise false
protected IsOptionOn ( SqlBulkCopyOptions option ) : bool
option SqlBulkCopyOptions The option to test for.
return bool

PrepareMapping() public method

Prepares the mapping for use, by default, it uses the schema mapping. This is the preferred appraoch
public PrepareMapping ( ) : void
return void

PrepareSchema() protected abstract method

Prepares the schema of the target table
protected abstract PrepareSchema ( ) : void
return void

SqlBulkInsertOperation() protected method

Initializes a new instance of the SqlBulkInsertOperation class.
protected SqlBulkInsertOperation ( ConnectionStringSettings connectionStringSettings, string targetTable ) : System
connectionStringSettings System.Configuration.ConnectionStringSettings Connection string settings to use.
targetTable string The target table.
return System

SqlBulkInsertOperation() protected method

Initializes a new instance of the SqlBulkInsertOperation class.
protected SqlBulkInsertOperation ( ConnectionStringSettings connectionStringSettings, string targetTable, int timeout ) : System
connectionStringSettings System.Configuration.ConnectionStringSettings Connection string settings to use.
targetTable string The target table.
timeout int The timeout.
return System

SqlBulkInsertOperation() protected method

Initializes a new instance of the SqlBulkInsertOperation class.
protected SqlBulkInsertOperation ( string connectionStringName, string targetTable ) : System
connectionStringName string Name of the connection string.
targetTable string The target table.
return System

SqlBulkInsertOperation() protected method

Initializes a new instance of the SqlBulkInsertOperation class.
protected SqlBulkInsertOperation ( string connectionStringName, string targetTable, int timeout ) : System
connectionStringName string Name of the connection string.
targetTable string The target table.
timeout int The timeout.
return System

ToggleOption() protected method

Turns a bulkCopyOptions on or off depending on the value of on
protected ToggleOption ( SqlBulkCopyOptions option, bool on ) : void
option SqlBulkCopyOptions The to turn on or off.
on bool true to set the on otherwise false to turn the off.
return void

TurnOptionOff() protected method

Turns the option off.
protected TurnOptionOff ( SqlBulkCopyOptions option ) : void
option SqlBulkCopyOptions
return void

TurnOptionOn() protected method

Turns the option on.
protected TurnOptionOn ( SqlBulkCopyOptions option ) : void
option SqlBulkCopyOptions
return void

onSqlRowsCopied() protected method

Handle sql notifications
protected onSqlRowsCopied ( object sender, System.Data.SqlClient.SqlRowsCopiedEventArgs e ) : void
sender object
e System.Data.SqlClient.SqlRowsCopiedEventArgs
return void

Property Details

Mappings public_oe property

The mapping of columns from the row to the database schema. Important: The column name in the database is case sensitive!
public IDictionary Mappings
return string>.IDictionary