ilikemypizza
ilikemypizza

Reputation: 347

SQL Server Alter Table Query (Incorrect Syntax)

I'm stumped, and I know this is probably something very simple. I am trying to add two columns to an existing table.

I am receiving the following syntax error:

Incorrect syntax near 'PublishedDate' Expecting '(', or SELECT.

Here is my SQL:

ALTER TABLE my_table ADD (PublishedDate DATETIME, UnpublishedDate DATETIME)

Upvotes: 2

Views: 4098

Answers (1)

Lamak
Lamak

Reputation: 70678

Try without the parentheses:

ALTER TABLE my_table 
ADD PublishedDate DATETIME, UnpublishedDate DATETIME

Here is a sqlfiddle with a demo for you to try.

Upvotes: 6

Related Questions