To find the oldest active transaction, you can use the DBCC OPENTRAN command. See Msdn:http://msdn.microsoft.com/zh-cn/library/ms182792.aspx for detailed usage
Give an example:
Copy Code code as follows:
CREATE TABLE t_product (pkid
first, the phenomenon of problems When executing a SQL Server distributed transaction, you receive the following error under SQL Server 2005:Message 7391, Level 16, State 2, process xxxxx, line 16thThe operation cannot be performed because the OLE
The scope of this article: a comprehensive description of the various operations of SQL Server database, virtual host and server two cases.
This article is relatively long, please use the outline below to access.
Outline
First, the virtual host
1
What happens in SQL Server that causes its execution plan to turn from index lookup to index Scan (index Scan)? The following from a few aspects of context-specific scenarios to do the next test, summary, induction.
1: An implicit conversion causes
1, to determine whether the data table exists
Method One:
Use Yourdb;
Go
if OBJECT_ID (n ' tablename ', n ' U ') are NOT null
print ' exists '
else
print ' does not exist '
For example:
Use Fireweb;
Go
if object_id (n ' temp_
First things to NOTE: You must enable file and print sharing to successfully install MSDE. Otherwise, the installation process may continue until it is almost complete, and then unexpectedly rolled back, unable to complete the installation of MSDE.
What is precision: The total number of decimal digits that can be stored, including the left and right digits of the decimal point. The precision must be a value from 1 to the maximum precision 38. The default precision is 18.
Scale: The maximum
My device Inserts 2000 data per second into the database, 2 devices total 4,000, when inserted directly in the program with INSERT statement, the two devices at the same time insert about about 2,800, data loss about 1200, testing a lot of methods,
SQL UNION operator
The UNION operator is used to merge the result sets of two or more SELECT statements.
Note that the SELECT statement within the UNION must have the same number of columns. The column must also have a similar data type . Also,
1. Scalar function: The result is a single value that can contain the logical processing process. It is not possible to use nondeterministic system functions such as GETDATE ().
Copy Code code as follows:
--Scalar value function
-- ====
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
How to determine the presence of a table or database in SQL Server, but in actual use, you need to determine the status State bit:Some of these state bits can be set by the user using sp_dboption (read only, dbo use only, single user, and so on):
1
I. Scripting Basics1.USE statementSets the current database.2. Declaring variablesSyntax: DECLARE @ variable name variable typeAfter you declare a variable, the value of the variable is null before assigning the variable.Assigning a system function
A. Build a library, build a table, and add constraints.
1.1 Building the Library
Copy Code code as follows:
Use master
Go
if exists (SELECT * from sysdatabases where name= ' MyDatabase ')-Determine if there is a database name
SQL statement
Copy Code code as follows:
Reverse (substring reverse (path), 1,charindex ('/', reverse (path))-1)
How SQL takes out the character to the right of the last special character in a string, for example: 10*20*300, how do
Misunderstanding #18: The following several misunderstandings about FileStream
All errors
A) FileStream data can be stored remotely
No, because the FileStream data container (which refers to the NTFS folder in which the FileStream file is stored)
In general, there are several situations that require you to set the database to read-only:
1. Insert,update,delete Trigger
2. Check constraints and Delete triggers
3. Set the database to read-only
4. Put the table in a read-only filegroup
5. Reject
The index allocation Map,iam page tracks the extents used by an allocation unit in a 4 GB interval. An allocation unit is a set of pages that belong to a single partition of a datasheet or index. It consists of one of the following three types of
When managing the internal accounts and passwords of SQL Server, it's easy to assume that all of this is fairly secure. But that is not the case. Here, we list some very dangerous judgments for SQL Server passwords.
When managing the internal
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.