Rearrange Column Order in Navicat
Asked Answered
M

3

9

in navicat you can arrange the order of the columns but i have yet to find a way to sync the changes with the database. i saw a similar question here -> Rearrange column order in Sqlyog but haven't found anything similar in navicat. i have many tables that need to be fixed for export to excel and the order is important in the readability/presentation. typing out sql code for each move would be way too tedious. thanks in advance.

Maryannamaryanne answered 30/6, 2011 at 21:16 Comment(0)
D
9

you can't do it in navicat , you have to run a sql query for that purpose

Dedra answered 8/7, 2011 at 13:49 Comment(1)
thank you - it looks like i'll have to get another program to handle that.Maryannamaryanne
M
1

You can reorder columns using SQLyog. To change the sequence of columns in a table, select the table in the Object Browser and select Table -> More Table Operations -> Reorder Column(s) (Ctrl+Alt+R) from the popup menu.

Select any column and click Up or Down button to move the column up / down. Having re-sequenced the columns, click Re-Order to save the table with changed structure. The column data in the table gets re-arranged accordingly.

Maculation answered 12/8, 2011 at 10:44 Comment(0)
N
-3

This is a really old question i Stumbled on going to answer just in case someone needs Navicat provides the ability to change the column order in a table by using the design table feature Either right click on the table name or press ctr-d on the top of the screen there are arrows to move a column up or down By pressing on the SQL preview tab on the top you can actually see the ALTER TABLE statements navicat is going to run You can also copy-paste this Statement and run on any other test database you may have or as a git migration Its a good idea to always read the SQL Preview as some times Navicat may use DROP statements and you would want to take a backup before something like that

Nipha answered 12/7, 2015 at 5:5 Comment(1)
This is not true. Those arrows are for selecting data type, not for rearranging column order. Many databases such as Postgres, do not support column rearranging. In many cases you can recreate the table, or add on the column and move the data.Tempietempla

© 2022 - 2024 — McMap. All rights reserved.