Adding more than one column

  • I am trying to write a script to insert more than one column but the script I am making only inserts the column in the second line and I dont know why.

    In my code below, columnB is added to the table, but not columnA. I am stumped

    My sql is:

    CODE

    Alter table  [dbName].[dbo].[tableName] Add columnA bit Default 0 Not Null

    Alter table  [dbName].[dbo].[tableName] Add columnB bit Default 0 Not Null

    thanks for your help.

  • - end you statement with a semicolon ;

    - this also can do the trick

    alter TABLE [dbName].[dbo].[tableName]

    add  colx bit not null default 0 ,

           coly bit not null default 0 ;

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply