-4

I am getting started with T-SQL in Visual Studios 2013 and I was wondering how can you add new columns to an existing database table?

I have this snippet

ALTER TABLE [dbo].[Articles]
ADD COLUMNS
  TenLatMin  FLOAT     NULL,
  TenLatMax  FLOAT     NULL,
  TenLonMin  FLOAT     NULL,
  TenLonMax  FLOAT     NULL;

but it complains

incorrect syntax near FLOAT

What can be wrong about the code above?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user1949387
  • 1,245
  • 3
  • 21
  • 38
  • 4
    You should try the documentation first, before just making up your own syntax, throwing your hands in the air when it doesn't work, and then asking us how DARE this made up syntax not work? – Aaron Bertrand Dec 05 '13 at 21:56

1 Answers1

7

According to the documentation, you shouldn't have COLUMNS in there:

ALTER TABLE [dbo].[Articles]
ADD
TenLatMin  FLOAT     NULL,
TenLatMax  FLOAT     NULL,
TenLonMin  FLOAT     NULL,
TenLonMax  FLOAT     NULL;
Cristian Lupascu
  • 39,078
  • 16
  • 100
  • 137