Many people in the use of SQL Server Query Analyzer will encounter a problem, that is, the operation of the official library, worry about additions and deletions in case the wrong thing to do? The data is priceless!
Do we have to write a business statement every time to do this thing?
SMSS has actually provided me with a function to open the transaction on the Query Analyzer, that is, the statements you execute in the Query Analyzer are not immediately committed to the database, but are executed in the transaction, if you confirm that the operation is correct can commit, found that the error needs to be corrected immediately rollback back, The data is intact and happy. How to use the details of the following, for everyone to make a reference.
STEP1: Open SSMs, select Tools, Options,
STEP2: In the Options window select query execution, SQL Server, ANSI, tick set_implicit_transactions, click OK to save the success.
OK, after completing the above steps, when you open the new Query Analyzer, the transaction is automatically enabled. That is, whatever you do in the inside, as long as there is no commit, will remain in the transaction, the database will not have any changes, but note that if you manipulate the table if there are changes in the transaction, in addition to the operation of the query will cause the table to be locked, Until you execute a COMMIT or ROLLBACK statement.
A friend in need can start using this feature!
How to open a transaction for SQL Server Query Analyzer