For the complete documentation index, see llms.txt. This page is also available as Markdown.

BatchOperation

Use JSON array to create and execute the query as a Microsoft SQL Server batch operation.

Task version: 2.2.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

🗝ConnectionString : String

Connection string.

Default: Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword; Example: Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

Query : String

Query string for batch operation.

Default: - Example: INSERT INTO MyTable (id, first_name) VALUES (@id, @first_name)

InputJson : String

JSON array for batch operation.

Default: - Example: [{"Id":1,"first_name":"Foo"},{"Id":2,"first_name":"Bar"}]

Name
Description

ThrowErrorOnFailure : Boolean

(true) Throw an exception or (false) stop the Task and return result object containing Result.Success = false and Result.ErrorMessage = 'exception message'.

Default: True Example: true

CommandTimeoutSeconds : Int32

Number of seconds for the operation to complete before it times out.

Default: 60 Example: 60

SqlTransactionIsolationLevel : SqlTransactionIsolationLevel

Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

Possible values:

  • None: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • Default: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • ReadUncommitted: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • ReadCommitted: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • RepeatableRead: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • Serializable: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • Snapshot: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

  • Unspecified: Starts a database transaction with the specified isolation level.

Isolation evel specifies the transaction locking behavior for the connection.

None: No transaction is set up so there won't be a rollback if exception occurs.

Default: Default is configured by the SQL Server, usually ReadCommited.

ReadCommitted: (Default value in most of the SQL Servers). Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Unspecified: A different isolation level than the one specified is being used, but the level cannot be determined.

ReadUncommitted: A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

RepeatableRead: Locks are placed on all data that is used in a query, preventing other users from updating the data.Prevents non-repeatable reads but phantom rows are still possible.

Serializable: A range lock is placed on the System.Data.DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot: Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

Default: 4096 Example: SqlTransactionIsolationLevel.ReadCommitted

Task Result

Name
Description

Success : Boolean

Operation complete without errors. Example: true

RecordsAffected : Int32

Records affected. Example: 100

ErrorMessage : String

Error message. This value is generated when an exception occurs and Options.ThrowErrorOnFailure = false. Example: Login failed for user 'user'.

Task Changelog

Changelog for Task Frends.MicrosoftSQL.BatchOperation.

[2.2.0] - 2026-01-22

Changed

  • Improve execution of async methods.

[2.1.0] - 2024-08-26

Changed

  • Updated Newtonsoft.Json to the latest version 13.0.3.

[2.0.0] - 2024-08-05

Changed

  • [Breaking] The task now uses Microsoft.Data.SqlClient instead of System.Data.SqlClient.

[1.0.0] - 2023-02-03

Added

  • Initial implementation

Last updated

Was this helpful?