COMMIT Statement

Makes changes to the database permanent, or terminates a user-defined transaction.

Syntax

Syntax 1

COMMIT [ WORK ]

Syntax 2

COMMIT TRAN[SACTION ] [ transaction-name ]

Examples

Usage

Side effects:
  • Closes all cursors except those opened WITH HOLD.

  • Deletes all rows of declared temporary tables on this connection, unless they were declared using ON COMMIT PRESERVE ROWS.

Standards

  • SQL—ISO/ANSI SQL compliant.

  • Sybase—Supported by Adaptive Server Enterprise. Syntax 2 is a Transact-SQL extension to ISO/ANSI SQL grammar.

Permissions

Must be connected to the database.