SQL Flow Field Guide

COMMIT WORK

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

commit

What changes

Input
open transaction
Output or change
makes changes durable when @@TRANCOUNT reaches 0

Syntax at a glance

COMMIT [ WORK ] [ ; ]

Work example

A script uses the ISO form to commit the current transaction after validation.

Check the transaction count and error path before choosing COMMIT WORK. Keep the transaction boundary explicit.

Check your work COMMIT WORK. The commit closes the intended transaction level and all required work is visible.

Open Microsoft Learn for full syntax, permissions, and details for your version.