SQL Server distributed transactions

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

SQL Server sets uppercase letters

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

SQL Server data set intersection, union, and difference set operations

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

Comparison of charindex/patindex/like in sqlserver

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

SQL rollup usage subtotal Summary

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

When MSSQL has a large amount of data, you can create an index or add a field and save the Change Prompt timeout.

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

SQL Server database security management

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

Combine duplicate row data into one row in SQL using commas to separate

1. Define table VariablesCopy codeThe Code is as follows:DECLARE @ T1 table(UserID int,UserName nvarchar (50 ),CityName nvarchar (50)); Copy codeThe Code is as follows:Insert into @ T1 (UserID, UserName, CityName) values (1, 'A', 'shanghai ')Insert

Usage of case statements in SQL

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

The where condition has different order and different performance examples

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:

Several Methods for deleting duplicate data in SQL Server

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 @

SQL compute by Usage Analysis

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

SQL query efficiency considerations

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

SQL stored procedure

Copy codeThe Code is as follows:-- FunctionCREATE function fn_GetPy (@ str nvarchar (4000 ))Returns nvarchar (4000)-- WITH ENCRYPTIONAsBeginDeclare @ intLenintDeclare @ strRetnvarchar (4000)Declare @ temp nvarchar (100)Set @ intLen = len (@ str)Set @

SQL study Note 6 union result set usage

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)

Tips for using case when then in SQL collection functions

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 by sqlserver

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 code and results for the Efficiency Test of large data volume paging stored procedures

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 --

SQL Server statistics collection

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,

Common Methods for to merge able and exclude duplicate data

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

Total Pages: 923 1 .... 882 883 884 885 886 .... 923 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.