Can I logically reorder columns in a table?

后端 未结 8 1563
抹茶落季
抹茶落季 2020-12-15 02:04

If I\'m adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?

I don\'t want to mess with the physical

8条回答
  •  醉话见心
    2020-12-15 02:40

    It is not possible to change the order of the columns without recreating the whole table. If you have a few instances of the database only, you can use SSMS for this (Select the table and click "design").

    In case you have too many instances for a manual process, you should try this script: https://github.com/Epaminaidos/reorder-columns

提交回复
热议问题