Several interesting concepts in transaction operations

Source: Internet
Author: User
1. What is implicit transaction? This is actually a concept that is not easy to understand. Let's take a look at what the document says. When a connection is operated in a recessive transaction mode, the SQLServer Database Engine instance automatically starts a new transaction after committing or rolling back the current transaction. You do not need to describe the start of a transaction. You only need to commit or roll back each transaction. Implicit transaction mode to generate continuous

1. What is implicit transaction? This is actually a concept that is not easy to understand. Let's take a look at what the document says. When a connection is operated in a recessive transaction mode, the SQL Server database engine instance automatically starts a new transaction after committing or rolling back the current transaction. You do not need to describe the start of a transaction. You only need to commit or roll back each transaction. Implicit transaction mode to generate continuous

1. What is implicit transaction?

This is actually a concept that is not easy to understand. Let's take a look at what the document says.

When the connection is operated in implicit transaction mode, the SQL Server database engine instance automatically starts a new transaction after committing or rolling back the current transaction. You do not need to describe the start of a transaction. You only need to commit or roll back each transaction. The implicit transaction mode generates a continuous transaction chain.

When the implicit transaction mode is set to open for a connection, a transaction is automatically started when the database engine instance executes any of the following statements for the first time:

ALTER TABLE

INSERT

CREATE

OPEN

DELETE

REVOKE

DROP

SELECT

FETCH

TRUNCATE TABLE

GRANT

UPDATE

The transaction remains valid until a COMMIT or ROLLBACK statement is issued. After the first transaction is committed or rolled back, the database engine instance automatically starts a new transaction when the next connection to the U.S. space executes any of the preceding statements. This instance will continuously generate a hidden transaction chain until the hidden transaction mode is closed.

The implicit transaction mode can be SET either by using the Transact-SQL SET statement or by using database API functions and methods.

That is to say, an implicit transaction is a connection option. If it is enabled on a Hong Kong Vm, some special statements will automatically start a new transaction. Instead of explicitly starting in TRAN. However, this is not a good practice and may cause misunderstandings.

2. Transaction name and checkpoint name

The Name after the begin transaction statement is defined as the Transaction Name)

The Name after the save transaction statement is defined as the CheckPoint Name)

They can all be used as a target of rollback transaction.

3. rollback work and ROLLBACK TRANSACTION

Rollback work is equivalent to a rollback transaction without parameters. The Hong Kong server is rented and always rolled back to the beginning of the TRANSACTION, that is, the whole transaction rollback.

(SQL .90). aspx

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.