Transaction Control Language (TCL)
- database transactions are used to insert, update, or change records
- are auto-committed
- cannot undo them
- immediately made available to the database
- unless used alongside transaction control language
- are auto-committed
Transaction Control Language (TCL) is the set of commands used to help a user manage all the transactions taking place in a database.
- allows you to control the transactions that are generated from DML inserts, updates, and deletes
- Opening the script with
BEGIN TRANSACTIONstarts the process in SQL - Data workers use scripts to make administrative or design changes to a database
- TCL clauses:
COMMIT: Commits a transaction and makes changes available in the databaseROLLBACK: Rolls back to the last committed set of changesSAVEPOINT: Creates a point in the transaction that you can roll back to if needed
- must complete any transaction process that you start
- When you have open transactions on records,
- a lock will be created that will not allow others to edit