T-SQL Tutorial

T-SQL COMMIT WORK


T-SQL Commit work transaction

The COMMIT WORK transaction is the end point of a successful transaction.

Commit work syntax:

COMMIT [ WORK ] ;

Commit work example:

USE model;
GO
BEGIN TRANSACTION;
GO
DELETE FROM students WHERE id = 7 ;
GO
insert into students(id,first_name, last_name, gender,city, country, section)
values(7,'Ashley','THOMPSON','F','Liverpool','England', 'History');
GO
COMMIT WORK;
GO