Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Intermediate
Aug 26, 1999

SQL commands SET IMPLICIT_TRANSACTIONS vs. BEGIN TRANSACTION

In ANSI SQL, you are always in a transaction, because there is no BEGIN TRANSACTION statement. The purpose of the SET IMPLICIT_TRANSACTIONS command in SQL 7.0 is to allow T-SQL to be used in a way that is closer to standard SQL transaction semantics. Setting Implicit transactions ON begins a transaction on the server for each statement, and commits do not occur until they are issued manually. The transaction will not be rolled back or committed unless the user issues the commits or rollbacks statement. Thus, without IMPLICIT_TRANSACTIONS, each command is internally converted to:
begin tran
insert
commit tran
begin tran
insert

Compare this to the following if SET IMPLICIT_TRANSACTIONS is ON where the transaction continues till user issues specific commands:
begin tran
insert
insert
commit tran
(user issued command)

Jai Bardhan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date