How to DROP multiple columns with a single ALTER TABLE statement in SQL Server?

后端 未结 13 1064
星月不相逢
星月不相逢 2020-12-22 18:17

I would like to write a single SQL command to drop multiple columns from a single table in one ALTER TABLE statement.

From MSDN\'s ALTER TABLE documenta

13条回答
  •  一整个雨季
    2020-12-22 19:03

    ALTER table table_name Drop column column1, Drop column column2,Drop column column3;
    

    for MySQL DB.

    Or you can add some column while altering in the same line:

    ALTER table table_name Drop column column1, ADD column column2 AFTER column7;
    

提交回复
热议问题