Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    3

    Question Unanswered: add new column in between other columns (was "is it possible")

    Hi all

    can we add a new column in a table inbetween other columns.

    Sachin

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    no it isn't, you'll have to create a new table, populate it, and drop the old one
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    what does it matter that the column is in a particular place unless you do nasty stuff like SELECT *.

    Kaiser meaning data order of database has no Brett in the the.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  4. #4
    Join Date
    Sep 2005
    Posts
    3

    Can I......

    If it's not possible.

    can i change columns positions after adding columns at the end.

    Sachin

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    nope, that's not possible either

    if you must rearrange column order (you don't really need to, you know), see post #2
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well....yes and no...
    You can very easily use Enterprise Manager to insert a column anywhere in a table, or rearrange fields, or rename columns, or practically anything you want. Enterprise Manager will then create a script to create the new table, load your old data into it, delete the original, and rename the new one. You can view the script if you want, but it is not necessary.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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