What Is a Transaction?

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Hour 6.  Managing Database Transactions


graphics/newterm_icon.gif

A transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program. In a relational database using SQL, transactions are accomplished using the DML commands that were discussed during Hour 5, "Manipulating Data" (INSERT, UPDATE, and DELETE). A transaction is the propagation of one or more changes to the database. For instance, you are performing a transaction if you performed an UPDATE statement on a table to change an individual's name .

A transaction can either be one DML statement or a group of statements. When managing transactions, each designated transaction ( group of DML statements) must be successful as one entity or none of them will be successful.

The following list describes the nature of transactions:

  • All transactions have a beginning and an end.

  • A transaction can be saved or undone.

  • If a transaction fails in the middle, no part of the transaction can be saved to the database.

graphics/note_icon.gif

To start or execute transactions is implementation-specific. You must check your particular implementation for how to begin transactions. There is no explicit start or begin transaction in the ANSI standard.



Team-Fly    
Top
 


Sams Teach Yourself SQL in 24 Hours
Sams Teach Yourself SQL in 24 Hours (5th Edition) (Sams Teach Yourself -- Hours)
ISBN: 0672335417
EAN: 2147483647
Year: 2002
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net