5

Is it possible to rearrange a table's column order in SQL yog?

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
ripper234
  • 222,824
  • 274
  • 634
  • 905

2 Answers2

13

Yes. Table / More Table Operations / Reorder Columns (ctrl shift r)

O. Jones
  • 103,626
  • 17
  • 118
  • 172
0

Column order is irrelevant to a database, so there isn't any benefit beyond readability to reorganizing column order.

The only means of reordering a tables columns is to:

  1. Rename the current table to something else, like [tablename]_ORIG. A database won't allow identically named tables
  2. Create a new table with the column order you desire
  3. Copy the data from the old table into the new one
  4. Delete the old table
OMG Ponies
  • 325,700
  • 82
  • 523
  • 502