Summary sqlserver2012 Delete syntax: An item in the Delete datasheet

Source: Internet
Author: User

Today we summarize the SQL server2012 version of the database deletion syntax, that is, the use of Delete, we have to delete a data table data, for testing, this is my fifth lesson in learning database, knowledge is power!
Well, let's see what the grammar says!
Database deletion syntax: Delete from a table where the condition is specified.
The above is related to the syntax, as long as the corresponding to the relevant parameters are filled in, but when it comes to conditional query, often still have a lot of complicated situations appear, here to pay attention!
For example, we want to delete this data: ( 傅雷家书http://www.simayi.net/duhougan/2654.html读后感1000字So, how do you write the relevant statements? Let's try it out.
1. First, use DELETE to delete the statement
2. from which table
3, the table name should be dbo.bog.article
4. Where condition query: where id = 2654
OK, the relevant parameters are all done, let's combine these parameters to see what it looks like:
Delete from dbo.bog.article where id = 2654
This is the complete statement, after testing is not a problem, of course, before testing, you should back up the data, and then after testing and then restore the database, about how to back up the database method, has been said before, this is relatively simple.

Here's another note: Delete does not require column names and wildcards, it deletes the entire row instead of the column, deletes the specified column, uses the UPDATE statement, and the DELETE statement deletes rows from the table, or even deletes all rows in the table, rather than deleting the table itself.
Why do you want to learn about SQL database operation syntax? Because we can deal with some data problems in batch, reduce a lot of manual operation and labor, which is very important for us to learn programming, and when we hear that the writing of database statements is very important, in most cases, the related programming work is done by querying, deleting, updating, inserting and other database syntax.

Summary sqlserver2012 Delete syntax: An item in the Delete datasheet

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.