insert new columes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • little83
    New Member
    • Feb 2009
    • 26

    insert new columes

    dear all

    if I have table has three columes already and each have some values inside already

    and I want to add 6 columes extra for that table and put values 0 inside each of the new columes..

    I used the sql query



    ALTER TABLE mytable ADD columename int NULL

    but these create columes with null values but I want to create with 0 values and I tried to replace Null by 0 but I had an error



    any ideas
  • LogicMechanic
    New Member
    • Jan 2009
    • 6

    #2
    ALTER TABLE mytable ADD columename int NOT NULL

    Comment

    • little83
      New Member
      • Feb 2009
      • 26

      #3
      this solution doesn't work..in adition I want to insert zero value

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        set the default constraint...

        -- CK

        Comment

        • little83
          New Member
          • Feb 2009
          • 26

          #5
          what sql command for that??

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            Here, read this

            -- CK

            Comment

            Working...