Add a new table column to specific ordinal position in Microsoft SQL Server

后端 未结 9 962
北海茫月
北海茫月 2020-11-27 20:16

Is it possible to add a column to a table at a specific ordinal position in Microsoft SQL Server?

For instance, our tables always have CreatedOn, CreatedBy, LastModi

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 20:34

    To my knowledge there is no known method to change the order of the column. Behind the scenes SQL Management Studio does what Jose Basilio said. And if you have a big table then it is impractical to change the column orders like this way.

    You can use a "view". With SQL views you can use any order you like without getting affected by the table column changes.

提交回复
热议问题