SQL Server dual-Server setup and automatic data synchronization tutorial

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

Analysis of ADO. NET data connection pool

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

Delete two duplicate data records in an SQL statement and retain one record.

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

SQL Server bcp (data import and export tool) General Usage and command details

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

How to rename an SQLServer Database

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

How to obtain the first data record by grouping SQL statements

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

Difference, usage and example of JOIN and UNION in SQL

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

Sqlserver function for quickly generating the first letter of a Chinese character (Classic)

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

Special SQL statements (learning notes)

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

SQL Server Job synchronization (combined with backup job)

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

Obtain the name of a week

Udf_WeekDayNameCopy codeThe Code is as follows:Create function [dbo]. [udf_WeekDayName]()RETURNS @ WeekDayName TABLE ([Id] INT, [WeekDayName] NVARCHAR (15 ))ASBEGINInsert into @ WeekDayName ([Id], [WeekDayName]) VALUES (0, 'saturday'), (1, 'sunday'),

This database does not have a valid owner, so you cannot install the database relational diagram support object.

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

The EXEC (EXECUTE) function accesses the internal temporary trigger table of INSERTED or DELETED.

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

SQL Server lock TABLE statement sharing

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

SQL Server implements remote database backup and recovery through extended stored procedures

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:

SQL server script and batch processing command Summary

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

SQL statement for Time Processing

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-

SQL temporary table recursively queries subinformation and returns the recorded code

Copy codeThe Code is as follows:Declare @ Q_ID uniqueidentifierSet @ Q_ID = dbo. uf_GetParamValueByName (@ Params, '@ indicator id ');Declare @ QAExp_ID char (36) -- indicator attribute formula IDSet @ QAExp_ID = '3d2b8f3f-0B7E-46FD-9B33-050F846C2869

Obtain the latest SQL implementation code for each category

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

Total Pages: 923 1 .... 919 920 921 922 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.