• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 789
  • Last Modified:

Regarding set implicit_transactions on

Hi,

Can anybody help me in understanding the advantages  and disadvantages
of setting the implicit_transactions on or off

thanks,
0
schinni
Asked:
schinni
  • 2
1 Solution
 
nigelrivettCommented:
setting it on means that a transaction will be started but not committed for each update if there isn't one already so you will have to code either

update tbl set ...
commit tran

or
begin tran
update tbl set ...
commit tran


with it off you can code either

update tbl set ....

or
begin tran
update tbl set ...
commit tran

You can use @@trancount to see if a transaction has been started but not committed.
I would recommend to leave it off.

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
There are not "advantages" or disadvantages as such. The difference is for your convenience or security.
-> Set it on mean that you need explicitely use commit to save the last statements to the database. This means you can rollback after you saw the flaw in your code (before issuing the commit)
-> Set it off means that each statement is automatically committed. this can be "dangereous" (see above)
0
 
schinniAuthor Commented:
nigelrivett,
Is there any strong reason why you recommend that
0
 
schinniAuthor Commented:
thanks very much
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now