• Getting started
  • API Documentation
  • Pricing
  • Contact
Show / Hide Table of Contents
  • ETLBox.Connection
    • AccessOdbcConnectionManager
    • AdomdConnectionManager
    • ConnectionManagerType
    • Db2ConnectionManager
    • Db2ConnectionString
    • DbConnectionManager<Connection>
    • DbConnectionString<T, TBuilder>
    • IConnectionManager
    • IDbConnectionString
    • MariaDbConnectionManager
    • MariaDbConnectionString
    • MySqlConnectionManager
    • MySqlConnectionString
    • MySqlOdbcConnectionManager
    • OdbcConnectionManager
    • OdbcConnectionString
    • OleDbConnectionManager
    • OleDbConnectionString
    • OracleConnectionManager
    • OracleConnectionString
    • OracleOdbcConnectionManager
    • PostgresConnectionManager
    • PostgresConnectionString
    • PostgresOdbcConnectionManager
    • SqlConnectionManager
    • SqlConnectionString
    • SQLiteConnectionManager
    • SQLiteConnectionString
    • SqlOdbcConnectionManager
    • SqlOleDbConnectionManager
  • ETLBox.ControlFlow
    • ControlFlow
    • ControlFlowTask
    • DbTask
    • DropTask<T>
    • IfExistsTask
    • ILoggableTask
    • ITableData
    • LoggableTask
    • ProcedureDefinition
    • ProcedureParameter
    • QueryParameter
    • TableColumn
    • TableData
    • TableData<T>
    • TableDefinition
  • ETLBox.ControlFlow.Tasks
    • CalculateDatabaseHashTask
    • CleanUpSchemaTask
    • CreateDatabaseTask
    • CreateIndexTask
    • CreateProcedureTask
    • CreateSchemaTask
    • CreateTableTask
    • CreateViewTask
    • DropDatabaseTask
    • DropIndexTask
    • DropProcedureTask
    • DropSchemaTask
    • DropTableTask
    • DropViewTask
    • GetDatabaseListTask
    • IfDatabaseExistsTask
    • IfIndexExistsTask
    • IfProcedureExistsTask
    • IfSchemaExistsTask
    • IfTableOrViewExistsTask
    • RecoveryModel
    • RowCountOptions
    • RowCountTask
    • SqlTask
    • TruncateTableTask
    • XmlaTask
  • ETLBox.DataFlow
    • AggregateColumn
    • ChangeAction
    • ColumnMap
    • CompareColumn
    • DataFlow
    • DataFlowBatchDestination<TInput>
    • DataFlowComponent
    • DataFlowDestination<TInput>
    • DataFlowExecutableSource<TOutput>
    • DataFlowJoinTarget<TInput>
    • DataFlowSource<TOutput>
    • DataFlowStreamDestination<TInput>
    • DataFlowStreamSource<TOutput>
    • DataFlowTransformation<TInput, TOutput>
    • DeleteColumn
    • DistinctColumn
    • ErrorSource
    • ETLBoxError
    • ExcelColumn
    • ExcelRange
    • GroupColumn
    • ICacheManager<TInput, TCache>
    • IDataFlowBatchDestination
    • IDataFlowBatchDestination<TInput>
    • IDataFlowComponent
    • IDataFlowDestination
    • IDataFlowDestination<TInput>
    • IDataFlowExecutableSource
    • IDataFlowExecutableSource<TOutput>
    • IDataFlowLogging
    • IDataFlowSource
    • IDataFlowSource<TOutput>
    • IDataFlowStreamDestination
    • IDataFlowStreamDestination<TInput>
    • IDataFlowStreamSource
    • IDataFlowStreamSource<TOutput>
    • IDataFlowTransformation<TInput, TOutput>
    • IDataFlowTransformation<TOutput>
    • IdColumn
    • IMergeableRow
    • JoinTarget<TInput>
    • MatchColumn
    • MemoryCache<TInput, TCache>
    • MergeableRow
    • MergeMode
    • MergeProperties
    • Network
    • ResourceType
    • RetrieveColumn
    • StreamMetaData
    • TypeInfo
    • UpdateColumn
  • ETLBox.DataFlow.Connectors
    • ConcurrentMemoryDestination
    • ConcurrentMemoryDestination<TInput>
    • CsvDestination
    • CsvDestination<TInput>
    • CsvSource
    • CsvSource<TOutput>
    • CustomBatchDestination
    • CustomBatchDestination<TInput>
    • CustomBatchSource
    • CustomBatchSource<TOutput>
    • CustomDestination
    • CustomDestination<TInput>
    • CustomSource
    • CustomSource<TOutput>
    • DbDestination
    • DbDestination<TInput>
    • DbMerge
    • DbMerge<TInput>
    • DbSource
    • DbSource<TOutput>
    • ExcelSource
    • ExcelSource<TOutput>
    • JsonDestination
    • JsonDestination<TInput>
    • JsonSource
    • JsonSource<TOutput>
    • MemoryDestination
    • MemoryDestination<TInput>
    • MemorySource
    • MemorySource<TOutput>
    • TextDestination
    • TextDestination<TInput>
    • TextSource
    • TextSource<TOutput>
    • VoidDestination
    • VoidDestination<TInput>
    • XmlDestination
    • XmlDestination<TInput>
    • XmlSource
    • XmlSource<TOutput>
  • ETLBox.DataFlow.Transformations
    • Aggregation
    • Aggregation<TInput, TOutput>
    • AggregationMethod
    • BatchTransformation
    • BatchTransformation<TInput, TOutput>
    • BatchTransformation<TInput>
    • BlockTransformation
    • BlockTransformation<TInput, TOutput>
    • BlockTransformation<TInput>
    • CachedBatchTransformation
    • CachedBatchTransformation<TInput, TOutput, TCache>
    • CachedBatchTransformation<TInput, TOutput>
    • CachedBatchTransformation<TInput>
    • CachedRowTransformation
    • CachedRowTransformation<TInput, TOutput, TCache>
    • CachedRowTransformation<TInput, TOutput>
    • CachedRowTransformation<TInput>
    • CacheMode
    • ColumnRename
    • ColumnRename<TInput>
    • CrossJoin
    • CrossJoin<TInput>
    • CrossJoin<TInput1, TInput2, TOutput>
    • CrossJoin<TInput1, TInput2, TOutput>.InMemoryDestination<TInput>
    • Distinct<TInput>
    • LookupTransformation
    • LookupTransformation<TInput, TSource>
    • LookupTransformation<TInput, TSource>.PartialDbCacheSettings
    • MergeJoin
    • MergeJoin<TInput>
    • MergeJoin<TInput1, TInput2, TOutput>
    • Multicast
    • Multicast<TInput>
    • RowDuplication
    • RowDuplication<TInput>
    • RowMultiplication
    • RowMultiplication<TInput, TOutput>
    • RowMultiplication<TInput>
    • RowTransformation
    • RowTransformation<TInput, TOutput>
    • RowTransformation<TInput>
    • Sort
    • Sort<TInput>
    • XmlSchemaValidation
    • XmlSchemaValidation<TInput>
  • ETLBox.Exceptions
    • ETLBoxException
    • ETLBoxFaultedBufferException
    • ETLBoxNotSupportedException
  • ETLBox.Helper
    • BatchLinq
    • BulkSqlGenerator<T>
    • DataTypeConverter
    • ExpandoJsonPathConverter
    • HashHelper
    • IDataTypeConverter
    • JsonPathConverter
    • JsonProperty2JsonPath
    • JsonProperty2JsonPath.MultipleResultsInPath
    • ObjectNameDescriptor
    • PropertyInfoExtension
    • SqlParser
    • StringExtension
  • ETLBox.Logging
    • AbortLoadProcessTask
    • CreateErrorTableTask
    • CreateLoadProcessTableTask
    • CreateLogTableTask
    • CustomTask
    • EndLoadProcessTask
    • ETLLogLayoutRenderer
    • GetLoadProcessAsJSONTask
    • GetLogAsJSONTask
    • LoadProcess
    • LogEntry
    • Logging
    • LogHierarchyEntry
    • LogTask
    • Package
    • ReadLoadProcessTableTask
    • ReadLogTableTask
    • ReadOptions
    • Sequence
    • Sequence<T>
    • StartLoadProcessTask

Class SqlConnectionManager

Connection manager of a classic ADO.NET connection to a (Microsoft) Sql Server.

Inheritance
System.Object
DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>
SqlConnectionManager
Implements
IConnectionManager
System.IDisposable
Inherited Members
DbConnectionManager<SqlConnection>.DbConnection
DbConnectionManager<SqlConnection>.MaxLoginAttempts
DbConnectionManager<SqlConnection>.LeaveOpen
DbConnectionManager<SqlConnection>.ConnectionString
DbConnectionManager<SqlConnection>.State
DbConnectionManager<SqlConnection>.Transaction
DbConnectionManager<SqlConnection>.IsInBulkInsert
DbConnectionManager<SqlConnection>.PP
DbConnectionManager<SqlConnection>.SupportDatabases
DbConnectionManager<SqlConnection>.SupportProcedures
DbConnectionManager<SqlConnection>.SupportSchemas
DbConnectionManager<SqlConnection>.SupportComputedColumns
DbConnectionManager<SqlConnection>.IsOdbcOrOleDbConnection
DbConnectionManager<SqlConnection>.DoPrepareCommand
DbConnectionManager<SqlConnection>.ReadTableDefinition(ObjectNameDescriptor)
DbConnectionManager<SqlConnection>.CheckIfTableOrViewExists(String)
DbConnectionManager<SqlConnection>.CreateCommand(String, IEnumerable<QueryParameter>)
DbConnectionManager<SqlConnection>.ExecuteNonQuery(String, IEnumerable<QueryParameter>)
DbConnectionManager<SqlConnection>.ExecuteScalar(String, IEnumerable<QueryParameter>)
DbConnectionManager<SqlConnection>.ExecuteReader(String, IEnumerable<QueryParameter>)
DbConnectionManager<SqlConnection>.BeginTransaction(IsolationLevel)
DbConnectionManager<SqlConnection>.BeginTransaction()
DbConnectionManager<SqlConnection>.CommitTransaction()
DbConnectionManager<SqlConnection>.RollbackTransaction()
DbConnectionManager<SqlConnection>.CloneIfAllowed()
DbConnectionManager<SqlConnection>.Open()
DbConnectionManager<SqlConnection>.Close()
DbConnectionManager<SqlConnection>.CloseIfAllowed()
DbConnectionManager<SqlConnection>.Dispose(Boolean)
DbConnectionManager<SqlConnection>.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.Connection
Assembly: ETLBox.SqlServer.dll
Syntax
public class SqlConnectionManager : DbConnectionManager<SqlConnection>, IConnectionManager, IDisposable
Examples
ControlFlow.DefaultDbConnection = new SqlConnectionManager(new ConnectionString("Data Source=.;"));

Constructors

SqlConnectionManager()

Declaration
public SqlConnectionManager()

SqlConnectionManager(SqlConnectionString)

Declaration
public SqlConnectionManager(SqlConnectionString connectionString)
Parameters
Type Name Description
SqlConnectionString connectionString

SqlConnectionManager(String)

Declaration
public SqlConnectionManager(string connectionString)
Parameters
Type Name Description
System.String connectionString

Properties

AccessToken

If you provide an access token here, this token will be used for authentification with Sql Server

Declaration
public string AccessToken { get; set; }
Property Value
Type Description
System.String

ConnectionManagerType

The database type for the connection manager.

Declaration
public override ConnectionManagerType ConnectionManagerType { get; }
Property Value
Type Description
ConnectionManagerType
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.ConnectionManagerType

DisableCheckConstraints

If set to true, foreign key constraints will ot be checked when doing the bulk insert. By default, foreign key constraints are checked. To improve bulk insert performance, you can disable foreign key constrain checks.

Declaration
public bool DisableCheckConstraints { get; set; }
Property Value
Type Description
System.Boolean

DisableTriggers

If set to true, triggers will not be fired when doing the bulk insert. By default, all triggers are fired in bulk insert operations.

Declaration
public bool DisableTriggers { get; set; }
Property Value
Type Description
System.Boolean

MaxParameterAmount

returns the maximum amount of parameters that ca be passed into a sql query.

Declaration
public override int MaxParameterAmount { get; }
Property Value
Type Description
System.Int32
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.MaxParameterAmount

ModifyDBSettings

Will set the database settings SET PAGE_VERIFY NONE and SET RECOVERY BULK_LOGGED Settings will be reverted after the bulk insert operation.

Declaration
public bool ModifyDBSettings { get; set; }
Property Value
Type Description
System.Boolean

QB

The quotation begin character that is used in the database. E.g. SqlServer uses: '[' and Postgres: '"'

Declaration
public override string QB { get; }
Property Value
Type Description
System.String
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.QB

QE

The quotation end character that is used in the database. E.g. SqlServer uses: ']' and Postgres: '"'

Declaration
public override string QE { get; }
Property Value
Type Description
System.String
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.QE

Methods

AfterBulkInsert(String)

Called after every bulk insert of a batch

Declaration
public override void AfterBulkInsert(string tableName)
Parameters
Type Name Description
System.String tableName

Destination table name

Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.AfterBulkInsert(System.String)

BeforeBulkInsert(String)

Called before every bulk insert of a batch

Declaration
public override void BeforeBulkInsert(string tableName)
Parameters
Type Name Description
System.String tableName

Destination table name

Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.BeforeBulkInsert(System.String)

BulkDelete(ITableData)

Performs a bulk delete

Declaration
public override void BulkDelete(ITableData data)
Parameters
Type Name Description
ITableData data

Batch of data

Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.BulkDelete(ETLBox.ControlFlow.ITableData)

BulkInsert(ITableData)

Performs a bulk insert

Declaration
public override void BulkInsert(ITableData data)
Parameters
Type Name Description
ITableData data

Batch of data

Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.BulkInsert(ETLBox.ControlFlow.ITableData)

BulkSelect(ITableData, ICollection<String>, Action, Action, Action<Object>[])

Declaration
public override void BulkSelect(ITableData data, ICollection<string> selectColumnNames, Action beforeRowReadAction, Action afterRowReadAction, params Action<object>[] rowActions)
Parameters
Type Name Description
ITableData data
System.Collections.Generic.ICollection<System.String> selectColumnNames
System.Action beforeRowReadAction
System.Action afterRowReadAction
System.Action<System.Object>[] rowActions
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.BulkSelect(ETLBox.ControlFlow.ITableData, System.Collections.Generic.ICollection<System.String>, System.Action, System.Action, System.Action<System.Object>[])

BulkUpdate(ITableData, ICollection<String>, ICollection<String>)

Performs a bulk update

Declaration
public override void BulkUpdate(ITableData data, ICollection<string> setColumnNames, ICollection<string> joinColumnNames)
Parameters
Type Name Description
ITableData data

Batch of data

System.Collections.Generic.ICollection<System.String> setColumnNames
System.Collections.Generic.ICollection<System.String> joinColumnNames
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.BulkUpdate(ETLBox.ControlFlow.ITableData, System.Collections.Generic.ICollection<System.String>, System.Collections.Generic.ICollection<System.String>)

CleanUpBulkInsert(String)

Called after the whole bulk insert operation (all batches)

Declaration
public override void CleanUpBulkInsert(string tablename)
Parameters
Type Name Description
System.String tablename
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.CleanUpBulkInsert(System.String)

Clone()

Cretes a clone of the current connection manager

Declaration
public override IConnectionManager Clone()
Returns
Type Description
IConnectionManager

A instance copy of the current connection manager

Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.Clone()

CreateDbConnection()

By default, a db connection is created with the given connection string value. Override this method if you want to pass additional properties to the specific Ado.NET db connection.

Declaration
public override void CreateDbConnection()
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.CreateDbConnection()

PrepareBulkInsert(String)

Called before the whole bulk insert operation (all batches)

Declaration
public override void PrepareBulkInsert(string tablename)
Parameters
Type Name Description
System.String tablename
Overrides
ETLBox.Connection.DbConnectionManager<Microsoft.Data.SqlClient.SqlConnection>.PrepareBulkInsert(System.String)

Implements

IConnectionManager
System.IDisposable
Back to top Crafted with <3 in Berlin
Contact & legal notice