I. symptom When executing SQL Server distributed transactions, SQL Server 2005 receives the following error:Message 7391, level 16, status 2, process xxxxx, 16th rowsThis operation cannot be performed because the ole db access interface "SQLNCLI" of
Copy codeThe Code is as follows:/*-- Set uppercase letters for the first character string in SQLServer:-- Author: jinjazz/csdn-- Enable OLEAutomation in SQLServer2005Sp_configure 'show advanced options', 1;GoRECONFIGURE;GoSp_configure 'ole
For the relationship between them, refer to the following figure to show the relevant test examples: The test examples are as follows:Copy codeThe Code is as follows:Use tempdbGoIf (object_id ('t1') is not null) drop table t1If (object_id ('t2') is
I. test environment: 1. Database: SQL Server 20082. Test Table: 15000 records, char primary key, no other indexes3. Test Field: ntext type, maximum Data Length: 12000Ii. Test statement: 1. Select * from ProductTemp where ProductDesc like '% 192.168.7
Here is an example of SQL server2005:
Create table tb (province nvarchar (10), city nvarchar (10), score int)INSERT tb SELECT 'shaanxi ', 'xiance', 3Union all select 'shaanxi ', 'ankang', 4Union all select 'shaanxi ', 'hanzhong', 2Union all select
Generally, we all like to use the UI of the Database Manager to change the structure of the data table, and then naturally place the "save" button to save, but when the data volume is large, in this case, you will often see "you cannot create an
For database applications, database security is crucial. SQL Server's security function can protect data from unauthorized leaks and tampering! Below is a summary of the security chapter!
The first is a summary of the security object! Let's take a
How to Use Case in SQL
Case has two formats. Simple Case functions and Case search functions.Copy codeThe Code is as follows:-- Simple Case Function
CASE sex
WHEN '1' THEN 'male'
WHEN '2' THEN 'female'
ELSE 'others' END
-- Case search function
Case
I saw in the book yesterday that the where condition sequence is different for SQL statement optimization, and the performance is different. Is this recommended for Oracle11G? Method 1 is better than method 2?Method 1:Copy codeThe Code is as follows:
Method 1Copy codeThe Code is as follows:Declare @ max integer, @ id integerDeclare cur_rows cursor local for select Main field, count (*) from table name group by main field having count (*)> 1Open cur_rowsFetch cur_rows into @ id, @ maxWhile @
GROUPThe disadvantage of a clause is that the returned result set only contains the total data without the original detailed records. To do this in SQL SERVER, you can use the COMPUTE BY clause. The sum generated by COMPTE is used as an additional
1. the query conditions are accurate.Ii. SQL logic execution sequenceFROM --> JOIN --> WHERE --> GROUP --> HAVING --> DISTINCT --> ORDER --> TOPIii. HorizontalQuery required fieldsWhen connecting multiple tables in an SQL statement, use the table
Union result setCreate temporary data tableCopy codeThe Code is as follows:Create table T_TempEmployee (FIdCardNumber VARCHAR (20), FName VARCHAR (20), FAge int, primary key (FIdCardNumber ));Insert into T_TempEmployee (FIdCardNumber, FName, FAge)
So what is the use of the Set function?
Suppose the database has a table named student.
If you want to use this table to find out the numbers of men and women in Jiangxi province, the number of boys in Guangdong province, and the number of men and
Steps for manual differential backup
Character Type:
1. Restore the current database; Alter database Current database set recovery full --
2. Create a table cmd; Create table cmd (a image )--
3. Back up the current database to D: \ cmd1; Backup log
Test EnvironmentHardware: CPU core T5750 memory: 2 GBSoftware: Windows server 2003 + SQL server 2005OK, first create a database: data_Test, and create a table: tb_TestTable in this database.Copy codeThe Code is as follows:Create database data_Test --
1. Calculate the total score and rank each person Select name, sum (score) as allscore from stuscore group by name order by allscore2. Calculate the total score and rank each person Select distinct t1.name, t1.stuid, t2.allscore from stuscore t1,
The Code is as follows:Copy codeThe Code is as follows:/// /// Combine two different able columns into a new DataTable/// /// source table /// tables to be merged /// list of required duplicates (empty) /// maximum number of rows in the merged
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service