Forums » .NET » SQL Server »

what is sql transaction....?


Posted Date: 24 Sep 2008      Posted By:: Vinod Krishna Profile photo    Member Level: Gold    Member Rank: 906     Points: 1   Responses: 4



hi



Responses

#299802    Author: Perin      Member Level: Silver      Member Rank: 0     Date: 24/Sep/2008   Rating: 2 out of 52 out of 5     Points: 1

sql trancation means
ACID
atomicity ,consistancy, isolation, durablty


 
#299833    Author: Sherrie      Member Level: Silver      Member Rank: 1919     Date: 24/Sep/2008   Rating: 2 out of 52 out of 5     Points: 6

SQL-Transaction Statements
SQL-Transaction Statements control transactions in database access. This subset of SQL is also called the Data Control Language for SQL (SQL DCL).
There are 2 SQL-Transaction Statements:

COMMIT Statement -- commit (make persistent) all changes for the current transaction
ROLLBACK Statement -- roll back (rescind) all changes for the current transaction
Transaction Overview
A database transaction is a larger unit that frames multiple SQL statements. A transaction ensures that the action of the framed statements is atomic with respect to recovery.
A SQL Modification Statement has limited effect. A given statement can only directly modify the contents of a single table (Referential Integrity effects may cause indirect modification of other tables.) The upshot is that operations which require modification of several tables must involve multiple modification statements. A classic example is a bank operation that transfers funds from one type of account to another, requiring updates to 2 tables. Transactions provide a way to group these multiple statements in one atomic unit.

In SQL92, there is no BEGIN TRANSACTION statement. A transaction begins with the execution of a SQL-Data statement when there is no current transaction. All subsequent SQL-Data statements until COMMIT or ROLLBACK become part of the transaction. Execution of a COMMIT Statement or ROLLBACK Statement completes the current transaction. A subsequent SQL-Data statement starts a new transaction.

In terms of direct effect on the database, it is the SQL Modification Statements that are the main consideration since they change data. The total set of changes to the database by the modification statements in a transaction are treated as an atomic unit through the actions of the transaction.
http://www.firstsql.com/tutor5.htm


 
#299942    Author: Sabu C Alex      Member Level: Gold      Member Rank: 371     Date: 25/Sep/2008   Rating: 2 out of 52 out of 5     Points: 6

Hi vinod krishna

Transaction is a group of sql queries performed as a single logical unit of work. Transaction begins with a specific task and ends when all the tasks in the group successfully complete. If any of the tasks fails, the transaction fails.

The COMMIT Statement terminates the current transaction and makes all changes under the transaction persistent. That is all changes are recorded together in the database.
The ROLLBACK Statement terminates the current transaction and reversing all changes made under the transaction. That is if anything goes wrong with any of the grouped statements, all changes need to be aborted. The process of reversing changes is called rollback in SQL Server terminology.





 
#300713    Author: Venkatesh Murali      Member Level: Gold      Member Rank: 292     Date: 26/Sep/2008   Rating: 2 out of 52 out of 5     Points: 6

A transaction is a sequence of operations performed as a single logical unit of work. A logical unit of work must exhibit four properties, called the ACID (Atomicity, Consistency, Isolation, and Durability) properties, to qualify as a transaction:

Atomicity: A transaction must be an atomic unit of work; either all of its data modifications are performed or none of them is performed.

Consistency: When completed, a transaction must leave all data in a consistent state. In a relational database, all rules must be applied to the transaction's modifications to maintain all data integrity. All internal data structures, such as B-tree indexes or doubly-linked lists, must be correct at the end of the transaction.

Isolation: Modifications made by concurrent transactions must be isolated from the modifications made by any other concurrent transactions. A transaction either sees data in the state it was in before another concurrent transaction modified it, or it sees the data after the second transaction has completed, but it does not see an intermediate state. This is referred to as serializability because it results in the ability to reload the starting data and replay a series of transactions to end up with the data in the same state it was in after the original transactions were performed.

Durability: After a transaction has completed, its effects are permanently in place in the system. The modifications persist even in the event of a system failure.


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : questions IN SQL
Previous : how to manage error in sp on sql 2000 server?
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages

Subscribe to Subscribers
Awards & Gifts
Talk to Webmaster Tony John

Online Members

Gopi A
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India