question

GOT avatar image
GOT asked

How to add a column to the existing table?

I tried using this syntax alter table [Person].[Phonenumber] add column_name BusinessEntityID INT NOT NULL and got the error Msg 102, Level 15, State 1, Line 53 Incorrect syntax near 'INT'.
columnadd
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

When asking a question about a syntax error, it usually helps if you also post the code that gave you the error.
0 Likes 0 ·
That's probably the alter table bit. I formatted the code in the question so it would stand out better.
0 Likes 0 ·

1 Answer

· Write an Answer
mjharper avatar image
mjharper answered
you just don't need the column_name part: alter table [Person].[Phonenumber] add BusinessEntityID INT NOT NULL
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.