what is a transaction?

  • what is a transaction? I want to know the definition with example.


    Thanks & Regards,

    Niladri Kumar Saha

  • How about you check the glossary in Books Online. Then if you need further clarification, clearly state what you don't understand.

     

    --------------------
    Colt 45 - the original point and click interface

  • in simple terms transaction is a sequence of operations performed as a single logical unit of work

     




    My Blog: http://dineshasanka.spaces.live.com/

  • OK - its is a logical unit of work and BOL defines what can be combined in a transaction and what cannot. You need to be aware of the Begin Tran, Commit Tran, Rollback Tran statements, especially rollback on error checking. You can also name individual transactions and rollback to named points. 

  • In layman terms, imagine that you want to modify or update data in several steps.  However, should any one of those steps fail, you would like to revert your changes.  Transactions help you do this.  It's like an Undo unless all goes well.

    Begin Trans

      Step 1...

      Step 2...

      Step 3...

    Commit Trans

    After each step, you check for the error status.  If you catch an error, you can then ROLLBACK trans.

    This all can be nested, too.  So, you can have transactions within transactions.

    Hope that helps.  You should read the books on line to see examples and get a full understanding.

     

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply