Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 784
  • Last Modified:

Implicit Transactions

Hi experts, what is the appropriate setting to work with implicit transactions?
0
enrique_aeo
Asked:
enrique_aeo
  • 2
1 Solution
 
man2002uaCommented:
What do you mean by "appropriate settings"?
Just call "SET IMPLICIT_TRANSACTIONS ON"
and don't forget to commit your work. This mode is similar to Oracle default behaviour.
0
 
enrique_aeoAuthor Commented:
sorry, wrong question. scenarios in which I use
0
 
man2002uaCommented:
Understood, this mode is mostly used for Oracle developers, who switching to MSSQL.
In this mode any DDL, DML will start one transaction (untill next COMMIT). The default setting for MSSQL server - each DDL/DML use single transaction.
Exmaple:
-- default mode
delete from tableA;
go
delete from tableB;
go
-- all changes already in DB.
Here you dont need to commit, MSSQL did it for you.
but for:
set implicit_transaction on
go
delete from tableA;
go
delete from tableB;
go
-- at this point you can call rollback and rollback changed
-- or commit to save cahnges
commit
go
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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