COMMIT Statement

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

Quick Links:

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

Syntax 1 – To end a transaction and makes all changes permanent

COMMIT [ WORK ]

Syntax 2 – To construct nested transactions

COMMIT TRAN[SACTION ] [ transaction-name ]

Examples

(back to top)

Usage

(back to top)

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

(back to top)

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

Permissions

(back to top)

Must be connected to the database.