Forum Stats

  • 3,872,660 Users
  • 2,266,452 Discussions


Need a command to reorder columns in a table

Torsten Kleiber
Torsten Kleiber Member Posts: 198 Bronze Badge
edited Jan 11, 2016 6:01PM in Database Ideas - Ideas

This isuseful from performance point of view if the columns changes for null to not null or in the other direction.

Not null columns, escpecially primary and foreign key columns are filled ever and should be at the start of a database block to keep it as small as possible.

The way to reach this goal is very complex and error prone at the moment:

- renaming the original table

- creating a new table with original name and the changed order

- inserting the values in the new table from the old table

- reassign foreign keys from old table to new table

- drop renamed old table

Torsten KleiberborneselUser259623 -Oraclerajeev.y.ranjan-OracleCarsten Kaftanvinaykumar2markmevanscaadecarvalhoJitendraArpit Jain -OracleJagadekaraulohmann#Mayuruser7904656
24 votes

Active · Last Updated