Description: The hardware and software environments used are Windows XP SP2, SQL Server 2000 SP2 Personal Edition, General dual-core desktop, M LAN, and host A is an existing Server with databases and massive data, machine B is the new server. Both
This article originated from discussing the concept of connection pool with C # MVP Zhang Xiang during gcr mvp Open Day. Therefore, write an article to analyze the connection pool.Why connection pool? The first question to analyze a technology is
-- Any test tableCopy codeThe Code is as follows:Create table test_delete (Name varchar (10 ),Value INT);Go-- Zhang San 100 and Wang wu80 are duplicate.Insert into test_deleteSELECT 'zhang san', 100Union all select 'zhang san', 100Union all select
Bcp is a command line tool used in SQL Server to import and export data. It is based on DB-Library and can efficiently import and export large batches of data in parallel. Bcp can be used to export tables or views of a database, or filter tables or
The Enterprise Manager does not have the function to change the database name. If you must use the Enterprise Manager, you can back up the database and restore it. You can specify another database name during restoration, then delete the old
Use the Northwind database
First, query the Employees table.
Query results:
There are only five cities in the city Column
Use ROW_NUMBER () OVER (partition by COL1 order by COL2) to group data first. Note:Group by COL1, sort by COL2 within the
1. Difference Between JOIN and UNIONJoin is a record set generated by the records with the same conditions in the two tables after the join operation,Union is the two record sets generated (the fields must be the same) and are combined to form a new
The Code is as follows:Copy codeThe Code is as follows:USE [tempdb]GO/***** Object: UserDefinedFunction [dbo]. [fun_getPY] Script Date: 05/23/2012 18:03:45 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO/*Obtain the first Pinyin of Chinese
[1] Return in XML(1) undefined attributesSelect logisticsId, logisticsName from LogisticsCompany for xml auto, elements(2) define the attribute sectionCopy codeThe Code is as follows:Select top 21 AS Tag,Null as Parent,Title_id AS [titles! 1!
The code of the core export job is similar to that of the job backupCopy codeThe Code is as follows:Alter PROC DumpJob (@ job VARCHAR (100 ))ASDECLARE @ retrun NVARCHAR (max)DECLARE @ jobname VARCHAR (30), @ category_calss_ I INT, @ category_calss
After creating a new database or attaching a database, if you want to add a relational table, the following error occurs:The database does not have a valid owner, so you cannot install the database relational diagram support object. To continue, use
At the beginning, this table had very few fields (less than 10). The former developer wrote all the stored procedures, triggers, and table functions of this table to death. Each time you add some fields, you must manually modify these stored
Lock a table in the databaseSELECT * FROM table WITH (HOLDLOCK)Note: What is the difference between locking a database table?SELECT * FROM table WITH (HOLDLOCK)Other transactions can read tables, but cannot update or Delete tables.SELECT * FROM
Advantages and disadvantages of stored procedures:Advantages of stored procedures: 1. The T-SQL Process Code becomes more complex as the application changes over time, adding or deleting functionality, and StoredProcedure provides a replacement
This article explains how to extend the stored procedure of SQL Server database through examples to achieve remote backup and recovery.Instance description:Environment: win2k + sqlserver 2 K + query AnalyzerSQL SERVER service instance name:
I. Script Basics1. USE statementSet the current database.2. Declare VariablesSyntax: DECLARE @ variable name variable typeAfter a variable is declared, the value of the variable is NULL before the value is assigned.Assign the system function to the
Copy codeThe Code is as follows:-- Get the current timeSelect getdate ()-- Obtain the current year, month, and day. YY indicates the year, MM indicates the month, DD indicates the day, hh indicates the day, and ss indicates the second./*Year yy 1753-
Create table table1 ([ID] [bigint] IDENTITY (1,1) not null, [Name] [nvarchar] (128) not null, [class] int not null, [date] datetime not null) class indicates the category number. The number of categories is not fixed. There are at least thousands of
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.