[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 787
  • 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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