SQL Delete multi-column statements

Source: Internet
Author: User

Recently, in the process of writing SQL found that a table structure needs to be adjusted (here is SQL Server), which need to delete multiple columns, because the previous is a SQL statement to delete a column, so guess whether a statement can delete multiple columns at the same time, if so, how to write?

The first conjecture is as follows (note: Here is conjecture, not the correct wording):

ALTER TABLE DROP COLUMN Column1,column2

However, after the execution, found the syntax error, and then changed to the following way:

ALTER TABLE DROP column column1,column Column2

Execute correctly, then look at the table structure and find that the column has been deleted, proving that the conjecture is correct.

SQL Delete multi-column statements

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.