01. How SQL Server reads and writes data

Source: Internet
Author: User
1. Data read/write process as a relational database, SQL Server naturally maintains the ACID feature of transactions, and the read/write conflicts of databases are controlled at the transaction isolation level. No matter whether the transaction is enabled or not, the transaction exists. Flowchart: data read/write flowchart 0. Transaction start (1) All DML statements must be based on transactions.

I. Brief data read/write process as a relational database, SQL Server naturally maintains the ACID feature of transactions, and the read/write conflicts of databases are controlled at the transaction isolation level. No matter whether the transaction is enabled or not, the transaction exists. Flowchart: data read/write flowchart 0. Transaction start (1) All DML statements must be based on transactions.

1. Brief data read/write process
As a relational database, SQL Server naturally maintains the ACID feature of transactions. The Hong Kong Server is rented and the read/write conflicts of databases are controlled at the transaction isolation level. No matter whether the transaction is enabled or not, the transaction exists. The flowchart is as follows:


Data read/write Flowchart

0. Start transaction
(1) All DML statements must be transaction-based. In the U.S. space, if the transaction is not explicitly enabled, the Hong Kong server manually writes begin tran, SQL Server regards each statement as a transaction and automatically submits the transaction.

That is to say, SQL SERVER does not enable implicit transactions by default. This is the opposite of ORACLE. ORACLE enables implicit transactions by default. Each DML statement or statement block must be manually committed.

To change the default behavior in SQL Server, you can make the following settings in the session. If no implicit transaction is opened, SQL Server automatically submits the current DML statement, manual COMMIT is required for submission.

IMPLICIT_TRANSACTIONS TEST_TRAN (id int) insert into TEST_TRAN VALUES (1) OPENTRAN ()

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.