Transactional control commands allow users to manipulate various transactions in maintaining database integrity. In SQL, transactions begin when applications are executed. The very first transaction is started at the onset of the SQL application, while the last transaction is ended when the application is terminated. The following are the common transactional control commands:
COMMIT – This statement completes a transaction by making the changes you made to the database permanent, or simply saving the transactions. Its syntax is:
COMMIT [WORK];
ROLLBACK – This statement’s primary function is to restore the database system to its previous state or undo all the actions that took place in the transaction log. Its syntax is:
ROLLBACK [WORK];
SAVEPOINT – This statement works with the ROLLBACK command, wherein it creates sections or points within groups of transactions in which you will be performing the ROLLBACK command. Its syntax is:
SAVEPOINT SAVEPOINT_NAME;
Before you start overwhelming yourself with various database solutions and SQL command lines, you need to determine first your purpose why you are creating a database. This will further determine other database design considerations such as size, complexity, type of machine where the application will run, storage medium and more. When you start thinking of your database requirements, you need to know up to what level of detail should be considered in your design. Too much detail will result to a very complex design that further wastes time and effort, and even your computer’s storage space. Too little will lead to a poor performing, corrupt and worthless database. Once you are done with the design phase, then you can decide which database software you can download to start your SQL experience.
COMMIT – This statement completes a transaction by making the changes you made to the database permanent, or simply saving the transactions. Its syntax is:
COMMIT [WORK];
ROLLBACK – This statement’s primary function is to restore the database system to its previous state or undo all the actions that took place in the transaction log. Its syntax is:
ROLLBACK [WORK];
SAVEPOINT – This statement works with the ROLLBACK command, wherein it creates sections or points within groups of transactions in which you will be performing the ROLLBACK command. Its syntax is:
SAVEPOINT SAVEPOINT_NAME;
Before you start overwhelming yourself with various database solutions and SQL command lines, you need to determine first your purpose why you are creating a database. This will further determine other database design considerations such as size, complexity, type of machine where the application will run, storage medium and more. When you start thinking of your database requirements, you need to know up to what level of detail should be considered in your design. Too much detail will result to a very complex design that further wastes time and effort, and even your computer’s storage space. Too little will lead to a poor performing, corrupt and worthless database. Once you are done with the design phase, then you can decide which database software you can download to start your SQL experience.
Comment