Insert, update, and delete XML data in SQL Server

XML is added to SQL Server. the Modify () method is xml. modify (insert), xml. modify (delete), xml. modify (replace) corresponds to XML insert, delete, and modify operations.The following XML is used as an example to describe three DML

Overview of common scripts for routine database maintenance and some tests

Some database statements may not be used much at ordinary times. Therefore, it is difficult to query the database over the Internet when using the statements. On the CSDN forum today, I saw these statements, and I copied them, I tried to copy the

Usage example of using DataTable as a Stored Procedure Parameter

I have written several stored procedures in my recent work and need to pass strings to the stored procedures. Because SQL Server 2000 does not have built-in functions similar to split, I have to handle them myself, it is very troublesome to split a

How to send emails through SQL stored procedures

How does SQL Server configure email sending?Generally, we all know that SQL Server and Microsoft Exchange Server are well integrated. The configuration in this regard is described in detail in SQL Server's online help and will not be repeated here.

SQL Server errors: 16th-day data corruption and Restoration

Misunderstanding #16: multiple data corruption and repair misunderstandingsMany of the popular versions are incorrect.I have heard a lot about what data restoration can do, what cannot be done, what can cause data corruption, and whether the damage

SQL Server misunderstanding: About 21st days of data corruption can be solved by restarting SQL Server

Misunderstanding #21: database corruption can be solved by restarting SQL Server or Windows, or attaching and detaching a databaseErrorNo operation in SQL Server can repair data corruption. Damaged pages must be repaired or restored through some

SQL Server Stored Procedures return values with transaction concatenation id

Deleting a message will cascade the reply information. At this time, we need to use the transaction, as shown in the following SQLCopy codeThe Code is as follows:Alter procedure [dbo]. [proc_tb_leaveword_delete](@ LeavewordID INT,@ Record TINYINT

Analysis on the Impact of statistics on queries in SQL Server

When the analyzer looks for a path, it does not count the number of rows and ranges of values contained in the index every time, instead, the information is created and updated based on certain conditions and saved to the database. This is the

SQL statement used by sqlserver to modify the column name and table name

The Code is as follows:EXEC sp_rename 'table name. [original column name] ', 'new column name', 'column'Transact-SQL referenceSp_renameChange the name of the user-created object (such as a table, column, or user-defined data type) in the current

Determines whether the trigger is processing insert, delete, or update.

However, sometimes, you can view the logic of the process and write the three into a trigger, only to make a slight judgment.You can determine from the following method whether the trigger is triggered by processing the insert, delete, or

Application of sqlserver isnull in Database Query

Isnull is used in database queries, especially when the statement is connected.For example, if a field has no value but needs to be left connected to another table during connection, it will be empty,Isnull can be used to determine whether it is

Understanding logical reads, pre-reads, and physical reads in SQL SERVER

SQL SERVER Data Storage Format Before talking about several different reading methods, you must first understand the SQL SERVER data storage methods. the minimum unit of SQL SERVER storage is Page ). the size of each page is 8 KB. SQL SERVER

Solutions to SQL Server table deadlock

In fact, not only will the table be locked as described above, but there are also many scenarios that will cause a deadlock in the Table. Unlocking is actually very simple. The following example is used to explain:1. First create a test table:Copy

How to Use sp_xml_preparedocument to process XML documents

Sometimes some XML data is processed in the stored procedure. Therefore, sp_xml_preparedocument is used to read the XML data and analyze it using the MSXML analyzer (Msxmlsql. dll. We can easily get the data we want in XML in the stored procedure.

Summary of SQL server script update for Databases

Table replication:1. insert into select statementStatement format: Insert into Table2 (field1, field2,...) select value1, value2,... from Table1The target table Table2 must exist. Because the target table Table2 already exists, We can insert

How to change sa user name in SQLServer

First, run the following code in the query Analyzer of the Enterprise Manager. (Note that the user name used to enter the query analyzer must be System administrator and the database owner of each database ):Copy codeThe Code is as

SQLSERVER Pager store procedure paging Stored procedure

Copy codeThe Code is as follows:SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCreate procedure [dbo]. [Pagination]@ Page int = 1, -- current Page number@ PageSize int = 10, -- number of records per page (page size)@ Table nvarchar (500), -- Table

SQLSERVER records the logon time of the logged-on user (self-written script)

A while ago, the manager asked me if I could record the last time the user logged on to our business database, because someone had previously modified the logon password of the database sa user, so we should record it.I checked the information. It

SQL Server misunderstanding: 4th-day DDL trigger is the INSTEAD trigger

Misunderstanding #4: DDL triggers (introduced after SQL Server 2005) are INSTEAD triggers This is wrong The implementation principle of DDL triggers is actually an AFTER trigger. This means that a DDL operation is performed first, and then the

SQL Server CONVERT () function usage Summary

How to Use CONVERT:Format:CONVERT (data_type, expression [, style])Note:This style is generally in the time type (datetime, smalldatetime) and string type (nchar, nvarchar, char, varchar)It is used only when they are converted to each

Total Pages: 923 1 .... 516 517 518 519 520 .... 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.