'How to change the column order of an Azure database table in Visual Studio

I've been searching all afternoon for the way to re-order columns of an Azure database table in MS Visual Studio 2022. No luck.

In other applications columns are easily re-arranged by dragging or cut & paste.

No can do here. At this point, I'm not even sure columns can be moved in VS.

I'm only interested in the VS output view. I'm not interested in altering the database.

More specifically, I need two columns, which are on opposite ends of the table to be moved next to each other for a QA task. If this can't be done, I would have to jump or scroll from one end of the row to the other (across multiple screen views). If I can compare the columns next to each other, the task will take hours. If I can't, it will take weeks.

I guess another option would be to temporarily hide all the columns in between. That would be a less preferable but acceptable solution, as well.

Any guidance would be appreciated. Thank you.



Solution 1:[1]

If the table has no data in it then just replace it with one that has columns in the order you want.

If the table contains data then

  1. Create a new table with the columns in the order you want
  2. Copy the data from the old to new table
  3. Drop the old table, rename the new table

Or create a view over the existing table and query the view rather than the table

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NickW