.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Home >> Articles >> DataBase >> Post New Resource Bookmark and Share   

 Subscribe to Articles

DataBase Transaction?

Posted By:Syed Shakeer Hussain       Posted Date: February 19, 2009    Points: 15    Category: DataBase    URL: http://www.dotnetspark.com  

DataBase Transaction?


A transaction begind when the first DML statement is encountered and ends when one of the following occurs:


  1. A COMMIT or ROLLBACK statement is issued
  2. A DDL statement such a CREATE is issued
  3. A DCL statement is issued


There are two Types of Transaction Control Statements:


  1. Explicit Transaction Control Statements
  2. Implicit Transaction Control Statements


Explicit Transaction Control Statements :


 You can Control the logic of transactions by using the COMMIT,SAVEPOINT and ROLLBACK statements.




Satae of the Date after COMMIT:

 Ends the current transaction by making all Pending data changes Permanent.


a)    The previous state of the data is permanently lost

b)    All users can view the results of the transaction

c)     The locks on the eaffected rows are released

d)    All save Points are erased



  Delete from emp where empid=101;

     1 row deleted.


  Insert into emp values(101,'smile');

     1 row inserted.


   Commit the changes:



    Commit Complete.




Marks a savepoint within the current transaction.




a)    It ends the current transaction by discarding all pending data changes

b)    Previous state of the data is restored.

c)     Locks on the affected rows are released.



Delete from emp;

10 rows deleted.



Rollback Complete.


Delete from emp where empid=101;

1 row deleted.



Implicit Transaction Control:


  An automatic commit occurs under the following circumstances:


a)    DDL statement is issued.(Create ,Alter,Drop,Rename,Truncate)

b)    DCL statement is issued.(Grant and Revoke)

c)     Normal exit without issuing COMMIT or ROLLBACK Statements


  An automatic Rollback occurs under an abnormal termination.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend