Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009

    Unanswered: Adding a column to a database table

    Hello i want to add another bit column to my table.

    Columns were

    userID ---- userName

    Now i want to add a column

    userID ---- userName ---- isSuperUser

    Now i have values in my table.

    I want to add the column isSuperUser to my table and set old row's isSuperUser column to 1 ...

    How can I achieve this?

    Do i need to drop the table and create it again?

  2. #2
    Join Date
    Apr 2008
    Iasi, Romania
    Provided Answers: 2
    Sybase documentation for ALTER TABLE:
    SyBooks Online

    is any system datatype except bit or any user-defined datatype except those based on bit.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    Join Date
    Aug 2009
    hello ,

    you can using this command

    1> alter table table name add isSuperUser datatype
    2> go

    then use this command

    1> update table name
    2> set isSuperUser=1
    3> go

    good luck
    Last edited by smart_DBA; 08-27-09 at 10:32.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts