Skip to content

ConnectionPromises.Function.execSqlBatch

Christian d'Heureuse edited this page Oct 15, 2026 · 1 revision

tedious-plus / ConnectionPromises / execSqlBatch

Function: execSqlBatch()

function execSqlBatch(connection, request): Promise<number>;

Defined in: ConnectionPromises.ts:302

Executes an SQL batch block.

This is the promisified version of Connection.execSqlBatch(). It is used to e.g. execute blocks of an SQL script.

The SQL code runs within the scope of the session. Changed settings and local temporary tables (#tmp) persist in the session across batches.

SQL parameters are not supported with execSqlBatch().

Parameters

connection

Connection

An open Tedious connection.

request

Request

The Tedious request to be executed.

Returns

Promise<number>

A promise for the number of rows affected, or 0. The promise is rejected when the request fails.

Clone this wiki locally