Class MssqlProvider

Assembly: redb.Export.dll

implementation for Microsoft SQL Server.

Uses for high-throughput inserts and
sp_MSforeachtable to toggle constraints and triggers during import.

public sealed class MssqlProvider : IDataProvider, IAsyncDisposable

Inheritance

ObjectMssqlProvider

Implements

Properties

Connection

Returns the underlying instance.

public DbConnection Connection { get; }

Name

Short provider identifier (e.g. "postgres", "mssql").

public string Name { get; }

Methods

BulkInsertAsync(string, DataTable, CancellationToken)

Performs a bulk insert of the supplied

public Task BulkInsertAsync(string tableName, DataTable data, CancellationToken ct = default)

CleanDatabaseAsync(CancellationToken)

Truncates all REDB tables in the correct foreign-key order, leaving the schema intact.

public Task CleanDatabaseAsync(CancellationToken ct = default)

DisableConstraintsAsync(CancellationToken)

Disables foreign-key constraints and triggers so that rows can be

public Task DisableConstraintsAsync(CancellationToken ct = default)

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or

public ValueTask DisposeAsync()

EnableConstraintsAsync(CancellationToken)

Re-enables foreign-key constraints and triggers after bulk import.

public Task EnableConstraintsAsync(CancellationToken ct = default)

GetSequenceValueAsync(CancellationToken)

Returns the current value of the global_identity sequence.

public Task<long> GetSequenceValueAsync(CancellationToken ct = default)

OpenAsync(string, CancellationToken)

Opens a connection to the database using the supplied connection string.

public Task OpenAsync(string connectionString, CancellationToken ct = default)

SetSequenceValueAsync(long, CancellationToken)

Resets the global_identity sequence to the specified value

public Task SetSequenceValueAsync(long value, CancellationToken ct = default)