1. Four properties of a transactionAtomic Atomicity, consistency consistency, isolation isolation, persistent durability, acid properties.atomicity : A transaction must be a unit of complete work, either fully executed or not executed at
The result set--select query can be used as an alias as a virtual table with Select*from (Select*from score, grade where score.degree between Low and UPP) as Jibieta ble where rank= ' A '--create view (view can only be based on entity table) CREATE
1 How to lock a row in a table2 locking a table for a databaseSELECT * from Table with (HOLDLOCKAdd lock Statement: sybase: update table set col1= col1 where 1 = 0 ; MSSQL: select col1 from table ( Tablockx) where 1 Span style=
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
User feedback said to find duplicate document number, check found that the following document number was assigned to a different two employeesThe system uses the statement exec getnewordernumber ' pwgnumber ', ' PWG ', 1, @pwg_number outputTo
1. Deadlock PrincipleAccording to the definition in the operating system: A deadlock is a permanent wait state in which each process in a set of processes occupies a resource that is not freed, but is placed in a form that is not freed by other
Original: http://www.cnblogs.com/yun_shuai/archive/2010/09/20/1831546.html/*1. Minor error (Severity level 0-10): By default, the client program is not sent an error message to continue working. Which means it can't be caught in a catch.2. Medium
SQL Server Deadlock Summary1. Deadlock PrincipleAccording to the definition in the operating system: A deadlock is a permanent wait state in which each process in a set of processes occupies a resource that is not freed, but is placed in a form that
--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
I. Some batch processing statements have been written in the previous course. These batch processing statements have two problems: 1. parameters cannot be passed for running (customized) Like functions. 2. there is no way to call it repeatedly like
Dead Lock)
A deadlock is a situation where processes block each other and a block loop is formed to prevent unblocks. A deadlock must occur between two or more processes. For two processes, process a blocks process B, and process B blocks process.
1. Transaction)Transactions mainly take into account the security performance and correctness of data in exceptional circumstances. For example, a transfer program has several statements that execute different functions, and now the money is drawn
Three Common Phenomena of database transactions:
1 dirty read: uncommitted read. (A is changed to 20, B reads 20, and a rolls back to 18 .)
Scenario: the default level of most databases is, orcal. Therefore, it does not appear unless the isolation
1. transaction isolation
Transaction isolation is a function provided by the database.
SQL Server uses the SET transaction isolation level statement to set the transaction isolation level:
SET transaction isolation level
{Read uncommitted
| Read
First:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Declare @ iErrorCount int
Set @ iErrorCount = 0
Begin tran Tran1
Insert into t1 (Id, c1) values (1, '1 ')
Set @ iErrorCount = @ iErrorCount +
The purpose of writing this essay is to clarify some of the facts and opinions in my previous article "abandon the auto-increment ID of the database and expose the solution I used". At the same time, I will continue to answer the concurrent
In the past few days, some stored procedures have been written in the project process to process some business logic. It is found that there are only a few stored procedures in the database, on the other hand, a very small module involves several
Transaction attributes
Transactions have ACID properties
That is, atomic atomicity, consistent consistency, isolated isolation, durable permanent
Atomicity
That is, the transaction should be taken as a unit of work, and the transaction is
Create a table:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Set
Ansi_nulls
On
Go
Set
Quoted_identifier
On
Go
Create
Table
[
DBO
]
.
[
T1
]
(
I always thought that the stored procedure would automatically implement transaction operations. Stored Procedures only support transaction operations. To implement transaction operations, you must implement them by yourself.
Basically, there are
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.