Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    84

    Unanswered: altering table with default value

    Hi, How to alter a table with default value?
    I am using the below statement, But, it is not working..Any pointers?
    Thx..
    -------------------------------
    alter table action_item ALTER COLUMN STATUS default 0
    Kishore

  2. #2
    Join Date
    Mar 2004
    Posts
    84

    Here is the answer...

    ALTER TABLE ACTION_ITEM ADD CONSTRAINT
    DF_ACTION_ITEM_STATUS DEFAULT 0 FOR STATUS
    GO
    UPDATE ACTION_ITEM SET STATUS =0 where STATUS IS NULL
    GO
    Kishore

Posting Permissions

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