How to open a transaction for SQL Server Query Analyzer

Source: Internet
Author: User
Tags sql server query

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.