COMMIT in SQL Server 2008
In this article I describe COMMIT Transactional Command in SQL Server
Today we are playing around rollback and commit data control commands. Rollback command is the transactional command. These commands are used to ensure integrity within the database. First of all we create a table on which we enforce commit and rollback commands:
When we use commit in our commands than change made by command will be permanent. We can't rollback while using commit command. After commit transaction then transaction can not be rolled back.
begin tran transaction_name
Queries to execute
commit tran transaction_name
transaction_name: is name assigned to the transaction, in place of transaction_name we could specify transaction variable, savepoint name, or savepoint variable.
Queries to execute: defines the list of queries whose result is to be permanent.