Monday, April 19, 2010

SET IMPLICIT_TRANSACTIONS

This option is very useful in testing environment , we can test/analyze data by running queries against a table and data can be easily rolled back to the old state.

SET IMPLICIT_TRANSACTIONS ON

When a connection is in implicit transaction mode we must explicitly committed or rolled back. Otherwise, the transaction and all of the data changes it contains are rolled back when the user disconnects.

--*********** Implicit Transaction ON**************

SET IMPLICIT_TRANSACTIONS ON;

UPDATE wages SET hourly_wage = 200

SELECT * FROM wages

ROLLBACK TRANSACTION
[OR]
COMMIT TRANSACTION

When you are not COMMIT/ROLLBACK transaction explicitly , and try to close the connection you will get the following confirmation message box.


We can enable Implicit Transaction using Query options also

No comments:

Post a Comment