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 definition of a thing:The object of the database is atomic, and the concept of atomicity refers to something as a unit.From a database point of view, it is the smallest combination of one or more statements that are executed or not executed at
Directory:Interpreting error messagesRAISERRORTHROWInstanceUse @ @ERRORUsing Xact_abortUsing Try/catchTransactional statements in real-worldDeleteUpdateBank to withdraw moneyInterpreting error messagesMSG 547, Level A, state 0, line 11The INSERT
Transactions and locks in the database
ACID properties of a transaction
1,A (atomicity) atomicity
The transaction must be an atomic unit of work, or all of its data modifications, or none of them executed.
2,C (consistency) Consistency
When a
The example in this article describes the method of writing transactions in SQL Server stored procedures. Share to everyone for your reference, specific as follows:
database transactions in SQL Server are quite useful, and since many SQL beginners
Strictly speaking, these three production methods have certain intersections, and their positioning methods will be explained below
Strictly speaking, these three production methods have certain intersections, and their positioning methods will be
Advantage: there are few fields and the addition, deletion, modification, and query functions are available. However, the query is too general.
Disadvantages:
1. The classpath field defines the limit.
2. The primary key classid is not
1. Regarding the concurrency issue, that is, if I am browsing, and another user is modifying. An error occurs.SET transaction read onlySelect * from MERs where name = 'tree ';Commit;2. p227 transactions and rollback.Same life and death ..The
This series of articles I saw in the sqlskill.com's PAUL blog, many misunderstandings are more typical and representative, the original from the T-SQL Tuesday #11: Misconceptions about... EVERYTHING !!, After translation and arrangement by our team,
ASP tutorials. NET and SQL processing1: Write directly to SQLWrite SQL statements directly, the SQL statement itself can have transactions, have transactions, in the stored procedure using the BEGIN TRAN,COMMIT Tran rollback TRAN. Advantages:
Primary keys are generated in three main ways:
A. Automatic database generation
Two. GUID
Three. Development and Creation
Strictly speaking, these three kinds of production methods have a certain intersection point, its positioning mode will be
Isolation level for SQL Server transactionsDatabase is to be shared by the vast number of customers to access, then in the database operation process is likely to occur in the following kinds of uncertainty.Update missing (Lost update)Two
Transferred from: http://blog.csdn.net/eseaqyq/article/details/7795023————————————————————————————————————————————————————Speaking of the deadlock in the data, has been repeatedly encountered in the written questions. Today is a summary of the
Understanding Transactions and LocksTransactions: The essential tool for maintaining logical data consistency and recoverability.Lock: When multiple users access the same database resource, a mechanism for the priority authority management of access,
It is recommended that you read the stored procedure first: SQL Server stored ProcedureØ BusinessIn a database, it is sometimes necessary to run instructions from multiple steps as a whole that either succeeds or fails altogether, which requires a
For more information about how to add, modify, delete, and describe fields, see.
For more information about how to add, modify, delete, and describe fields, see.
The Code is as follows:
-- New table Field
ALTER procedure [dbo].
Today, I suddenly noticed this problem. I have read a lot from the Internet and have benefited a lot. Record it and review it later ~ I have encountered this problem in my work before. Two users operate on one record at the same time. User A queries
Summary of several methods for implementing transactions in. Net:1. transactions are implemented using SQL statements in the background database, and the transfer service is implemented on the Database End using statements, as shown below:
Set
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.