There are three primary key generation methods:1. Automatic database generationIi. GUIDIii. Development and CreationStrictly speaking, these three production methods have certain intersections, and their positioning methods will be explained
1.1.1 Summary If we want to optimize the database, we can optimize the database system using the following five methods.1. Computer hardware optimization2. Application Optimization3. Database INDEX OPTIMIZATION4. SQL statement Optimization5.
1.1.1 SummaryI believe you are not familiar with SQL Transcation. It ensures data consistency and security of the database. Especially when adding or deleting data, if exceptions or errors occur, it triggers transaction rollback, this ensures data
SQL Join may be messy during learning. We know that the Join Syntax of SQL has many inner, outer, and left clauses. Sometimes, it is not clear about the result set of Select statements. In an article on Coding Horror (it is not clear why Coding
Why use transactions?When updating multiple tables, an execution fails. Transaction rollback is required to maintain data integrity.Display Set transactionsCopy codeThe Code is as follows:Begin tryBegin transactionInsert into shiwu (asd) values
We all know that the system stored procedures cannot be exported using tools (you can try> task> Generate SQL scripts)Because system stored procedures are generally not modified by developers.Knowledge required:1. Use the xp_cmdshell command2. sp_MS_
Copy codeThe Code is as follows:Use tempdbIf object_id ('tempdb .. # table') is not null drop table tempdb .. # tableSelect name into tempdb .. # tableFrom (select * from sysobjects where xtype = 'U') a whereA. name like '% test_select'Declare @
The first step must be to install the latest security patch for SQL SERVER. If this step is not completed, we will not continue.Step 2: Modify the default port 1433 and hide the SQL SERVER. In this way, it is prohibited to respond to broadcasts that
I. What is an index? One of the best ways to reduce disk I/O and logical reads is to use the index]The index allows SQL Server to search for data in a table without scanning the entire table.1.1. Benefits of indexes:When the table does not have a
Therefore, we plan to insert data into a temporary table before analyzing the data in the temporary table.The problem is how to dynamically create a temporary table. Originally, Insus. NET was implemented using the following code:Copy codeThe Code
According to the operation and experience in this article, we will have a basic and simplest understanding of SQL optimization. Other in-depth learning needs more information and practices:1. Create a table:Copy codeThe Code is as follows:Create
Once the hacker obtains webshell, the hacker will know your sqlserver administrator password. If sqlserver is no longer configured with security, the hacker can easily escalate the privilege and create a new system administrator account, then
Method 1:Copy codeThe Code is as follows:/* Create a linked server */Exec sp_add0000server 'srv _ lnk ', '', 'sqloledb', 'IP address of the bar code database'Exec sp_add1_srvlogin 'srv _ lnk ', 'false', null, 'username', 'Password'Go/* Query example
First, there are three tables. CNo corresponds to the course. Here I paste it.
Master table
Name of person
Query by regular
SELECT s. SName, c. CName, s2.SCgrade
From s s inner join SC s2 ON s2.SNo = s. SNo INNER JOIN C c ON c. CNo = s2.CNo
The
1, understanding of exists and in (refer to http://www.jb51.net/article/28922.htm)Exists: TRUE if the subquery contains a rowIn: If the operand is TRUE or equal to one in the expression list, it is TRUE.Exists always cannot understandSelect... From..
Think of TDE (Transparent Data Encryption ).Tde msdn description:TDE performs real-time I/O encryption and decryption on data and log files. This encryption uses the database encryption key (DEK), which is stored in the database Boot Record for
Osql is a Microsoft Windows 32 command prompt tool that can be used to run Transact-SQL statements and script files. The osql tool uses the ODBC database application programming interface (API) to communicate with the server.This article describes
The following test is used to remove the separator from any string.Copy codeThe Code is as follows:-- Remove consecutive delimiters from stringsDeclare @ str nvarchar (200)Declare @ split nvarchar (200), @ times intSet @ str = 'China 1 2 34 55 5 6 7
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.