Search code examples
sql-server-2005alter

Error while altering table in SQL Server


I'm just trying to add 2 columns to customer table

alter table CUSTOMER ADD ( CUSTOMERNAME VARCHAR(255) NULL
, CUSTOMERDESC VARCHAR(30) NULL )

but I get the following error when I try to run the script,

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

Can someone tell me what is the mistake that I'm doing. Thanks in anticipation


Solution

  • You don't need the brackets for an alter statement so remove them. ie:

    alter table CUSTOMER ADD   CUSTOMERNAME VARCHAR(255) NULL,   
    CUSTOMERDESC VARCHAR(30) NULL