SQL Server Performance

Reordering columns in table

Discussion in 'Getting Started' started by lcerni, Aug 15, 2007.

  1. lcerni New Member

    The only way I know to change the order of the columns in a table is by dropping the table and recreating it with the columns in the proper order. Is there another way in SQL Server 2005 that is easier?
  2. ndinakar Member

    First of all, why do you want it? How does the order of columns in the tables matter? When you write your SQL Query you should list out the column names in the order you want for your application. The order of columns in the table should not matter.
  3. lcerni New Member

    It doesn't matter to me. However, I have a developer who is making a lot of noise (very loudly) and management wants me to do it to quiet him.
  4. i2lovefishing New Member

    Enterprise Manager -> MyTable -> Design Table.
    Highlight a column and move it's position.
  5. ndinakar Member

    [quote user="lcerni"]
    It doesn't matter to me. However, I have a developer who is making a lot of noise (very loudly) and management wants me to do it to quiet him.
    [/quote]
    He should be fired.
  6. satya Moderator

  7. Madhivanan Moderator

    As said, ordinal posotion of the columns doesnt matter.
    In the front end, dont use Rs(0), Rs(1),.... Instead use Rs("column_name1"),Rs("column_name2"),.... where Rs is a RecordSet object
  8. FrankKalis Moderator

    Add the column to the table at the "end" and create a view for the developer in which you can mimic the ordinal positions that guy "requests" and have him access the view instead of the base table. That procedere offers many advantages apart from this one.

Share This Page