How to enable automatic transaction scoping on SQL

2019-02-22 02:34发布

问题:

I'm used to work with tools like Toad or PL/Sql Developer for Oracle and every SQL statement I run on the query window runs automatically under a trasaction scope. So, if my SQL statement is not correct, or even if I miss something on the SQL script I can rollback only by clicking on a button at the UI. If everything worked as expected, I can click on another button for commiting the current transaction. On those tools I mentioned, I don't need to write SQL statements for begin, commit or rollback a transaction. Every SQL statement has an implicit transaction associated with.

Is there a way to achieve the same functionality on SQL Server Management Studio 2008?

回答1:

You'd have to set "Implict Transactions" in tools..options..query execution

To enable COMMIT or ROLLBACK, I can only think of using the CTRL+number shortcuts



标签: tsql ssms