MS SQL Basics Tutorial: Deleting data

Source: Internet
Author: User

11.2.1 DELETE Syntax

The DELETE statement is used to delete data from the table, and its syntax is:

The parameters are described as follows:

From

This parameter is an optional option for connecting the DELETE keyword and the name of the object to delete the data. table_name

Specifies the table to delete data from. With ([... n])

Specifies the table hints allowed for one or more destination tables. View_name

Specifies the view used to delete data. rowset_function_limited

Rowset function restriction, that is, using the OPENQUERY () or OPENROWSET () function. From

Specifies an additional FROM clause. This is an extension of the DELETE command in a Transact-SQL language that allows the deletion of data from multiple tables at the same time. The parameters include Join_table, Join_type, and so on, which are consistent with the FROM clause in Chapter 10th "Data Query". WHERE

Specify criteria for restricting data deletion. If you do not specify a WHERE clause, all data in the table is deleted. Specify two forms of delete operations in the WHERE clause. One is to search for deletion, in addition to using search criteria to qualify data rows to be deleted: the other is to locate the deletion by specifying a cursor using the current OF clause, which will be generated at the present position of the cursor. Locating deletes is more accurate than searching for deletions. GLOBAL

Indicates that the cursor to use is a global cursor. If you do not use this option, and if there is a case with the same name as a global cursor and a local cursor, the system considers the selected cursor to be a local cursor. Cursor_name

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.