Let's take a look at the transaction processing technology in this article.Why use a transaction, what is the use of a transaction, for instance.Suppose we now have a business, as the success of something to the 2 table to insert data, a table, B
Database Operation deadlocks are inevitable. This article does not discuss how deadlocks are generated, but focuses on solving deadlocks. Through SQLServer2005, there seems to be a new solution. When the following SQL statement is placed in two
Viewing the properties of connection Retainsameconnection, the default value is False, which means that each task will use the connection separately, and each task will open and close the connection separately. Modify this property to True, and all
Metadata locks in SQLSERVER the metadata locks on the Internet are really very small, metadata locks will usually appear in the DDL statement below list the database engine can lock the Resource Description RID used to lock heap) A row of KEY is
The opening remarks are coming soon. after another year, I haven't met my cnblogs friend for a long time. I also saw a few of my MSSQL replies, which always said I was looking forward to my next good article. Alas! I'm sorry, but I haven't published
ArticleDirectory
Lab 1
Lab 2
SQL-92The standard defines four isolation levels, which are in the previous versionSQL ServerIs supported: Read uncommitted
Read uncommittedIs the weakest isolation level, because this level ignores
1. What is a transaction: a transaction is an inseparable logical unit of work. It is used as the smallest control unit to execute concurrent operations on the database system. All the database operation commands contained in the database are
Here are a few of my statistical options:
first Scenario (recursive):
The simple table structure is:
CategoryID Int (4),
CategoryName nvarchar (50),
ParentID Int (4),
Depth Int (4)
In this way, according to the parentid level of the use of
The SQL-92 standard defines four isolation levels, four of which are supported in previous versions of SQL Server:READ UNCOMMITTEDREAD Uncommitted is the least restrictive isolation level because the level ignores locks placed by other transactions.
SQL General optimization scheme:1. Using parameterized queries: Prevent SQL injection and precompile SQL commands for increased efficiency2. Remove unnecessary queries and search fields: In fact, in the actual application of the project, many of the
Source: Statistics in SQL Server histogram for no coverage of predicate predictions and changes in the estimation strategy (SQL2012-->SQL2014-->SQL2016)The source of this article: http://www.cnblogs.com/wy123/p/6770258.htmlStatistics have
A viewViews are SQL statements that are stored in queries in the database.A view is a table that is exported from one or more tables or views, and is a virtual table that can only be queried on the views and cannot be added, deleted, or
--things: To ensure the complete implementation of the entire process, all without problems of unified submission, once there is a problem, back to the original point--A stored procedure or trigger with BEGIN TRAN--the beginning of a
Symptom:
Create Three query statements in the query Analyzer
Begin tran
Select * From Table1 with (tablock, updlock)
After each execution,
Block the original query statement in the first query analyzer InterfaceThen writeCommit tran
At this time,
Related SQL statements:
Begin tran
Save tran
Commit tran
Rollback tran
Nested transaction example:
Begin Tran tran1
Begin Tran tran2
Commit Tran can specify a transaction name separately, such as tran1 and tran2. In fact, it has no effect. Even if
There are many infinite classification types on the network, but there are only two types: recursive algorithm and non-recursive algorithm ..
There are many infinite classification types on the network, but there are only two types: recursive
There are a few friends to suggest a combination of examples to illustrate, the previous article has said several types of locks, you can use the system dynamic view sys.dm_tran_locks see, the important fields are as follows:
Resource_type the type
Here are a few of my statistical options:
first Scenario (recursive):
The simple table structure is:
CategoryID Int (4),
CategoryName nvarchar (50),
ParentID Int (4),
Depth Int (4)
In this way, according to the parentid level of the use of
--This article has some mistakes, to be elegant, only for your reference
One: The background of the experiment
In daily work, some deadlock phenomena often occur and affect system performance.
Therefore, we need a way to monitor the deadlock in
One: Building an event session
1: Open the new Session Wizard
Expand Object Explorer-> Manage-> Extended event-> session-> New Session Wizard:
2: Introduction
3: Set session properties
Enter the extended event session name (tick "Start an event
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.