Alter Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ymk
    New Member
    • Nov 2006
    • 24

    Alter Table

    Simple SQL question.

    I am trying to add multiple columns to a temp table and the alter statement throws the following error.

    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near '('.

    The alter statement looks like this.

    ALTER TABLE #BillingData ADD (T2 FLOAT, T3 varchar(20) NULL)

    I thought you can add multiple columns putting the names in ( ).

    Any ideas where I am doing wrong.

    Thanks.
  • aaryan
    New Member
    • Nov 2006
    • 82

    #2
    Originally posted by ymk
    Simple SQL question.

    I am trying to add multiple columns to a temp table and the alter statement throws the following error.

    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near '('.

    The alter statement looks like this.

    ALTER TABLE #BillingData ADD (T2 FLOAT, T3 varchar(20) NULL)

    I thought you can add multiple columns putting the names in ( ).

    Any ideas where I am doing wrong.

    Thanks.
    hi ymk,
    remove the brackets after add. just
    alter table #billingdata add t2 float,t3 varchar(20) null

    Comment

    Working...