Database is no stranger to program apes, but how much do you know about database locks? Database lock directly affects data performance, how to ensure data is not deadlocked and improve database performance under the premise of large concurrency?
1. Open the database submitted read snapshot option2. The database has been submitted to read the test in snapshot modeA) test table testsb) Turn on transaction 1, update data C2 = ' 200 ' (not submitted)BEGIN TRAN UPDATE SET = ' $ ' WHERE = ' A ' -
Recently write a program often encounter deadlock victim, every time a face confused force. Study how to track down, write down the record.
Build test data
CREATE DATABASETestDB;GO UseTestDB;CREATE TABLEtable1 (idINT IDENTITY PRIMARY KEY,
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,
Original: 01. How SQL Server reads and writes dataI. Data reading and writing process briefSQL Server, as a relational database, also maintains the acid nature of the transaction, and the database read-write conflict is controlled by the transaction
(1) Stored procedures[1] Creating a stored procedure (no parameters)CREATE PROCEDURE ProtestaAsSELECT * FROM TestA--Modify the stored procedure (with parameters as output)Alter PROCEDURE Protesta@LastName varchar = NULL outputAsIf @LastName is
Summary of reasons for slow Oracle query speedThe reasons for the slow query are many, and the following are common:1, no index or no index (this is the most common problem of slow query, is the defect of program design)The 2,i/o throughput is small,
The stored procedure of SQL statement copying does not have USEmastergoIFEXISTS (SELECT * FROMdbo. sysobjectsWHEREidObject_id (N [dbo]. [sp_copyProce]) ANDObjectproperty (id, NIsProcedure) 1) DROPPROCEDURE [dbo]. [sp_copyProce]
In this tutorial, let's take a look at the SQL Server transactions, exceptions, and cursors. I hope this will help you. 1. Transaction features a transaction consists of several T-SQL commands, and all the commands last night a whole submitted to
To give full play to the advantages of ADO, not only need a comprehensive, in-depth understanding of the ADO programming model, timely experience, skills are also very important. ADO has many years of practical experience with ADO. NET provides a
There are many differences between the response T and notin on the Internet.
There are many differences between the returned results of random t and not in on the Internet.
It mainly describes the performance differences between consumer T and not
Questions raised by sys. dm_ OS _waiting_tasks of SQL Server Applications (I ),
Many users wait through sys when viewing SQL statements. view dm_exec_requests. The waiting type is also obtained through wait_type, sys. dm_ OS _waiting_tasks can also
What does SQL Server non-clustered index bring to us?
SQL Server Profiler is used to track the execution of SQL statements when a page is accessed. Because the application is very simple, three SQL statements are detected during page loading, after
How can I clear the Sybase master database logs when they are full? You can manage the master database by using the following methods. If you do not have enough space, you can consider resizing the master database.
1. In simple cases, dump trans
Use after an SQL statementSCOPE_IDENTITY ()Of course, you can also use SELECT @ IDENTITYHowever, the use of SELECT @ IDENTITY is globally up-to-date. incorrect values may be obtained.Example:Copy codeThe Code is as follows:Insert into dbo.
Good habits of SQL programming and good habits of SQL programming
| Reposted from: cnblog
| Original article: http://www.cnblogs.com/MR_ke/archive/2011/05/29/2062085.html
Most of us do not need to deal with databases when we develop software.
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
-- Delete the table use [20130823_Recource] godroptablemy_table1, my_table2, My_table3 -- create the table use [distinct] goif (exists (select * fromsys. objectswhere) Then (Idintprimarykeyidentity (1)
-- Delete the table use [20130823_Recource] go
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.