Analysis of ms SQL Server database transaction lock mechanism ■ Liu Yongming, Beijing Normal University
Locks are a very important concept in network databases. They are mainly used to ensure database integrity and consistency in
/* SQL XML entry: -- By erichu -- http://blog.csdn.net/chinahuyong 1, XML: Can Understand elements, attributes and values 2, XPath: Addressing language, similar to the Windows Directory Search syntax format (if the Dir command is not used, go to the
When measuring the function, run the following command to clear the SQL Server cache:
DBCC freeproccache
After clicking a button and executing the following statement, you can know what SQL statements and the number of times the system runs.
SQL injection attacks are hard to prevent. According to Microsoft's solution, stored procedures are used. However, if each SQL operation is implemented using a stored procedure, this is too troublesome.
What is a simple solution? Of course.That's -
A few days ago, because the domain administrator account was accidentally deleted, a new one was created. Then, the database administrator account can only be deleted and rebuilt. However, some problems are found during use and the database
First, add the reference system. serviceprocess. dll in Solution Explorer.
Then in. CSUsing system. serviceprocess;Then write in the eventCode:Servicecontroller SC = new servicecontroller ("MSSQLServer ");If (SC. Status = servicecontrollerstatus.
An isolated account means that the account of a database only has a user name but no logon name. Such a user exists in the sysusers system table of the user database, but there is no corresponding record in syslogins of the master database.
Two
Query:
When there are too many tables to be queried, it is annoying to manually write SQL statements. One way is to right-click the table, open the table, and query it. In addition, there are multiple table links, left join, etc,
Modify the table
I didn't know how to write it in the past. I have a cursor. Now I know it is easy to use.
Update
A
Set
_ Sum_passtime
=
B. A1,_ Sum_work
=
B. A2,_ Count_end
=
B. A3,_ Sum_tax
=
B. A4
From
# Tg_oo1,(
Select
How to query duplicate records of order numbers in SQL Server
Select * From DBO. Order Information ing relation where order number in (select order number from DBO. Order Information ing relation group by order number having count (Order Number)> 1
It cannot be used in functions. getdate ()For example:
Create
Function
Gettoday()
Returns
Datetime
As
Begin
Return
Convert
(
Char
(
10
),
Getdate
(),
120
)
End
The following error is
In general development, the database owner of SQL Server is DBO. But for security, it may be changed to another name.
It is not very convenient to change the owner. Two types are listed here for reference.
I:
--
-***************** Change
Recently, I encountered a sudden demand: Grouping A data table, and then retrieving the first n data entries in each group sorted by certain rules. At first glance, this is an ordinary query, with no difficulty. I can write it in a pen. After all, I
1. target readers: Database Development
Program Staff, there are a lot of data in the database, involving project developers who are interested in optimizing the SP (stored procedure.
II. Introduction: complex business logic and database
How to handle full SQL server logs
Transaction log file is a file used to record database updates with the extension LDF.In SQL Server 7.0 and SQL Server 2000, if the automatic growth function is set, the transaction log file is
In project development, we encountered the following problem: data needs to be imported from another system to the new system. the SQL server services of the two systems are located on different SQL Server servers.
I tried to write a stored
CodeAdd comments to help beginners.
Use
[
Master
]
Go
If
Exists
(
Select
*
From
SYS. Databases
Where
Name
=
'
Test_1
'
)
Drop
Database
Test_1
Go
--
Create a new
SQL Server 2000 queries n to M records?
(1)
Select top M * From tablename where id not in (select Top n id from tablename)
(2 ).
Select top M *
Temporary table (or table variable) from tablename order by columnname -- insert top M
This error occurs when DNN 4.8 is installed.
Connection Error (s ):Index #:0Source:. Net SqlClient Data ProviderClass:20Number:53Message:An error has occurred while establishing a connection to the server.When connecting to SQL Server 2005, this
SQLDMO (SQL Distributed Management Objects, SQL Distributed Management object) encapsulates Objects in the Microsoft SQL Server database. SQLDMO is the application interface used by the enterprise manager in Microsoft SQL Server. Therefore, it can
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.