Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drop Multiple Column Using single Alter

I searched a lot on web, but couldn't find the answer for dropping multiple columns in single alter statement using SQL Server 2008.

I tried following query

ALTER TABLE TableToDropColumn DROP (Field2, Field3)

but it throws an error

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '('.

like image 969
Nitin Varpe Avatar asked Feb 03 '26 07:02

Nitin Varpe


1 Answers

ALTER TABLE TableToDropColumn DROP COLUMN Field2, Field3

SQLFiddle demo

like image 65
juergen d Avatar answered Feb 05 '26 01:02

juergen d