SQL Server delete a specified record

Source: Internet
Author: User

Use SQL statements to delete a specified record
Delete a specified record using the delete statement in an SQL statement.
The delete statement syntax is as follows:
Delete from <Table Name> [where <search_condition>]
Parameters:
Table Name: name of the data table.
Where: Specifies the condition used to limit the number of rows to be deleted. If the WHERE clause is not provided, delete deletes all rows in the table.
Search_condition: specifies the conditions for deleting rows.
Example:
Use the delete statement to delete the student information whose name is "Wang X" in the "student" table.
Use student
Delete from student where name = 'wang x'
Go

For some data tables without a primary key or index, there are a large number of duplicate or NULL data records in the data table.

If you use the WHERE clause to limit the deletion conditions, some useful information in the data table will also be deleted. SQL Server provides the syntax for deleting null records in the delete statement.

Related Article

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.