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
Afficher le fichier Open project: ayende/rhino-etl

Méthodes publiques

Свойство Type Description
Mappings string>.IDictionary

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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
Résultat void

Execute() public méthode

Executes this operation
public Execute ( IEnumerable rows ) : IEnumerable
rows IEnumerable
Résultat IEnumerable

IsOptionOn() protected méthode

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

PrepareMapping() public méthode

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

PrepareSchema() protected abstract méthode

Prepares the schema of the target table
protected abstract PrepareSchema ( ) : void
Résultat void

SqlBulkInsertOperation() protected méthode

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.
Résultat System

SqlBulkInsertOperation() protected méthode

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.
Résultat System

SqlBulkInsertOperation() protected méthode

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.
Résultat System

SqlBulkInsertOperation() protected méthode

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.
Résultat System

ToggleOption() protected méthode

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.
Résultat void

TurnOptionOff() protected méthode

Turns the option off.
protected TurnOptionOff ( SqlBulkCopyOptions option ) : void
option SqlBulkCopyOptions
Résultat void

TurnOptionOn() protected méthode

Turns the option on.
protected TurnOptionOn ( SqlBulkCopyOptions option ) : void
option SqlBulkCopyOptions
Résultat void

onSqlRowsCopied() protected méthode

Handle sql notifications
protected onSqlRowsCopied ( object sender, System.Data.SqlClient.SqlRowsCopiedEventArgs e ) : void
sender object
e System.Data.SqlClient.SqlRowsCopiedEventArgs
Résultat 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
Résultat string>.IDictionary