I'm trying to Script some changes for one of our databases, and this is what I'm typing:
However, I receive an syntax error notification when I parse the code:
But I don't see the syntax error there. When I remove the "Column" keyword, and try to execute the command, it tries to add "id" as a Constraint, rather than a column, but when I add the Column keyword, that is the error I receive.
Does anyone see what I'm doing wrong here?
-Ovatvvon :-Q
Code:
ALTER TABLE [table_name]
ADD COLUMN [id] int IDENTITY(1,1) PRIMARY KEY NOT NULL
GO
However, I receive an syntax error notification when I parse the code:
Code:
[COLOR=red]Msg 156, Level 15, State 1, Line 10
Incorrect syntax near the keyword 'COLUMN'.[/color]
But I don't see the syntax error there. When I remove the "Column" keyword, and try to execute the command, it tries to add "id" as a Constraint, rather than a column, but when I add the Column keyword, that is the error I receive.
Does anyone see what I'm doing wrong here?
-Ovatvvon :-Q