# SQLServerBatchInsertStatement

open class SQLServerBatchInsertStatement(table: Table, ignore: Boolean = false, shouldReturnGeneratedValues: Boolean = true) : BatchInsertStatement

Represents the SQL statement that batch inserts new rows into a table, specifically for the SQL Server database.

Before adding each new batch, the class validates that the database's maximum number of inserted rows (1000) is not being exceeded.

## Constructors

SQLServerBatchInsertStatement
Link copied to clipboard
constructor(table: Table, ignore: Boolean = false, shouldReturnGeneratedValues: Boolean = true)

## Properties

arguments
Link copied to clipboard
open override var arguments: List<List<Pair<Column<*>, Any?>>>?

Cached argument rows for all currently registered batches.

insertedCount
Link copied to clipboard
var insertedCount: Int

The number of rows affected by the insert operation.

isIgnore
Link copied to clipboard
val isIgnore: Boolean
resultedValues
Link copied to clipboard
var resultedValues: List<ResultRow>?

The result rows produced for this statement after successful execution.

shouldReturnGeneratedValues
Link copied to clipboard
val shouldReturnGeneratedValues: Boolean
table
Link copied to clipboard
val table: Table
targets
Link copied to clipboard
val targets: List<Table>
type
Link copied to clipboard
val type: StatementType

## Functions

addBatch
Link copied to clipboard
fun addBatch()

Adds the most recent batch to the current list of insert statements.

arguments
Link copied to clipboard
open override fun arguments(): List<List<Pair<IColumnType<*>, Any?>>>

Returns all mappings of columns and expression types to their values needed to prepare an SQL statement.

contains
Link copied to clipboard
open operator fun contains(column: Column<*>): Boolean
get
Link copied to clipboard
infix operator fun <T> get(column: Column<T>): T
infix operator fun <T> get(column: CompositeColumn<T>): T
getOrNull
Link copied to clipboard
fun <T> getOrNull(column: Column<T>): T?

Returns the value of a given column from the first stored ResultRow, or `null` if either no results were retrieved from the database or if the column cannot be found in the row.

prepareSQL
Link copied to clipboard
open override fun prepareSQL(transaction: Transaction, prepared: Boolean = true): String

Returns the string representation of an SQL statement.

removeLastBatch
Link copied to clipboard
fun removeLastBatch()
set
Link copied to clipboard
open operator override fun <S> set(column: Column<S>, value: S)
open operator fun <T, S : T?, E : Expression<S>> set(column: Column<T>, value: E)
open operator fun <S> set(column: Column<S>, value: AbstractQuery<*>)
@JvmName(name = "setWithEntityIdExpression")
operator fun <S, ID : EntityID<S>, E : Expression<S>> set(column: Column<ID>, value: E)
@JvmName(name = "setWithNullableEntityIdValue")
operator fun <S : Any> set(column: Column<EntityID<S>?>, value: S?)
@JvmName(name = "setWithEntityIdValue")
operator fun <S : Any> set(column: Column<EntityID<S>>, value: S)
open operator fun <S> set(column: CompositeColumn<S>, value: S)
update
Link copied to clipboard
open fun <T, S : T?> update(column: Column<T>, value: () -> Expression<S>)

Updates the mapping of the specified column with the value of the provided expression.

open fun <T, S : T?> update(column: Column<T>, value: Expression<S>)

Updates the mapping of the specified column with the specified value if column has not been previously set up for a change and if value is of a valid type.