Start learning the T-SQL syntax below
I. Notes
-- Single-line comment, from this to the end of the line as a comment, similar to C ++, C ///*... */Multi-line comments, similar to C ++, C # In /*... */
Ii. variables (INT, smallint, tinyint, decimal,
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
There are many reasons for slow query speed. The following are common causes:1. No index or no index is used (this is the most common problem of slow queryProgramDesign defects)2. Low I/O throughput, resulting in a bottleneck effect.3. the query is
I was asked today:What is the minimum lock used by sqlserver to lock a row?Answer: Row-Level Lock
Check the document and obtain the lock information. (use the syslockinfo table of sql2k, and use the SYS. dm_tran_locks table of sql2k5 ):
Resource
This section describes SQL statements, sqltransaction, and transactionscope.
All examples in this section run in SQL Server 2008 and vs 2008 environments. If SQL Server 2005 is not available, the same applies to SQL Server, however, SQL se rver 2000
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
This section describes SQL statements, SqlTransaction, and TransactionScope. All examples in this section are run in sqlserver2008 and vs2008 environments. If sqlserver2008 is not available, the same applies to sqlserver2005, but sqlserver2000
There are many reasons for slow query speed. The following are common causes:
1. No index or no index is used (this is the most common problem of slow query and is a defect in programming)
2. Low I/O throughput, resulting in a bottleneck effect.
3.
Optimization of queries ~
There are many reasons for slow query speed. The following are common causes:1. No index or no index is used (this is the most common problem of slow query and is a defect in programming)2. Low I/O throughput,
There are many reasons for slow query speed. The following are common causes:1. No index or no index is used (this is the most common problem of slow query and is a defect in programming)2. Low I/O throughput, resulting in a bottleneck effect.3. the
SQL server databases are the most widely used relational databases. However, in actual application, many databases need to be optimized. When the data volume is particularly large, we must rely on the optimization of our team's database. Such as
Create a t_mongoadvertise table
The following fields are available:Automatic ID growth (main)Sortid int (main)Title nvarchar (50)
Create proc sp_ehotel_downadvertise
@ ID intAsDeclare @ sortid intDeclare @ tempsortid intDeclare @ tempid int
Begin
Part 1 Database SQL language
Data manipulation language (DML)
Data Manipulation Language,DMLIncluding insert, delete, and update statements for adding, deleting, and modifying data.
The following table tb_employeeinfo is used as an example:
Create
I have never carefully understood the UPDATE lock. I recently saw a problem on the MSDN forum asking about the deadlock issue of heap table UPDATE. The problem is very simple. There are tables and data like this:
Create table dbo. tb (
C1 int,
C2
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
SetXact_abort
Specify when the transact-SQL statementWhether Microsoft SQL Server automatically rolls back the current transaction when a running error occurs. Syntax
Set xact_abort {on | off} Note
When set xact_abort is on, ifWhen a running
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
]
(
Date:2006-03-25 17:23:39
Click:2834
Author:
Source:There are many reasons for slow query speed. The following are common causes:
1. No index or no index is used (this is the most common problem of slow query and is a defect in programming)
2. Low
I read the article "abandon database auto-increment ID, expose the solution I used" and display it on the homepage. I think that if a newbie does not distinguish between true and false and blindly follows suit, it will lead to the fact that he is
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.