Adding multiple columns to a table

is there a way to add multiple columns to a table with one alter statement? does Sql Server even support such?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

bwdowhanConnect With a Mentor Commented:
Yes you can,

Alter table my_table add
   [field1] [int] NULL,
   [field2] [varchar(30)] NULL,
   [field3} [int] NULL
oops... the last line should be [field3] [int] NULL

I mistype the closing square bracket as a closing curly bracket.
SireesConnect With a Mentor Commented:

alter  table tablename
add  Col1 varchar(10) ,  
     Col2 varchar(10)
crishna1Author Commented:
is this a new feature in 2005 or has it been there always? i thought Sql Server did'nt allow that earlier, i might be wrong.
Scott PletcherConnect With a Mentor Senior DBACommented:
That has been there for quite a while.  You can *add* several columns at once, but you can only *alter* one column at a time; perhaps that is what you were thinking of.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.