2

I tried to search for a previous answer but the most similar is on a completely different question.

On TOAD for Oracle when I press F5 on an update I still have to choose if I want to commit or rollback.

On SSMS the commit is automatic.

Can I configure it to the need for an explicit commit?

EDIT

I've found that my question has got an exact response here:

https://stackoverflow.com/a/8748818/196210

Community
  • 1
  • 1
Revious
  • 7,816
  • 31
  • 98
  • 147
  • possible duplicate of [How to enable automatic transaction scoping on SQL Server Management Studio?](http://stackoverflow.com/questions/3047676/how-to-enable-automatic-transaction-scoping-on-sql-server-management-studio) – Tim Schmelter Mar 28 '14 at 16:43
  • SSMS-Tools-Options: [set implicit transactions](http://tinyurl.com/o3glaku) (image inside) – Tim Schmelter Mar 28 '14 at 16:47
  • @TimSchmelter: please answer so that I can mark as accepted. – Revious Mar 28 '14 at 16:57

2 Answers2

2

You can set implicit transactions in SQL-Server Managemenet Studio. Therefore you have to change the default option from off to on here:

  • Tools
  • Options
  • Query Execution
  • SQL Server
  • ANSI
  • SET IMPLICIT_TRANSACTIONS

Here is an image:

enter image description here

Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
1

Put BEGIN TRANSACTION at the top of your script.

Or use SET IMPLICIT_TRANSACTIONS ON (courtesy of How do you set autocommit in an SQL Server session?)

Community
  • 1
  • 1
StingyJack
  • 19,041
  • 10
  • 63
  • 122