views:

31

answers:

3

I need to understand about sql server transaction? I have gone through some articles available on google but I have not understood anything. Can anyone help me?

+1  A: 

See Understanding Transactions.

Winston Smith
+1  A: 

You can explicitly start a transaction by writing BEGIN TRANSACTION. You end the transaction by running COMMIT TRANSACTION.

Before the COMMIT is run, the tables affected by your query can still be rolled back to the state they were in at the BEGIN TRANSACTION point-in-time.

This is useful when you are writing a stored procedure that is pumping a lot of data between tables. By dividing it in smaller parts using transactions, the whole bunch does not need to be "rolled back" when the procedure hangs, an error occurs or you cancel it manually.

An article that elaborates on this is for example this one.

littlegreen
A: 

Database Journal have a lot of good articles abaut mentoed subject

adopilot