如何在 sql server 2005 中使用 sql 查询更改表中的列顺序?

如何在 sql server 2005 中使用 sql 查询更改表中的列顺序?

问题描述:

如何在 SQL Server 2005 中使用 SQL 查询更改表中的列顺序?

How to change column order in a table using SQL query in SQL Server 2005?

我想使用 SQL 查询重新排列表中的列顺序.

I want to rearrange column order in a table using SQL query.

你不能.列顺序只是我们人类关心的装饰性"事情 - 对于 SQL Server,它几乎总是完全无关的.

You cannot. The column order is just a "cosmetic" thing we humans care about - to SQL Server, it's almost always absolutely irrelevant.

当您更改列顺序时,SQL Server Management Studio 在后台执行的操作是使用新的 CREATE TABLE 命令从头开始重新创建表,复制旧表中的数据,然后删除

What SQL Server Management Studio does in the background when you change column order there is recreating the table from scratch with a new CREATE TABLE command, copying over the data from the old table, and then dropping it.

没有定义列顺序的 SQL 命令.

There is no SQL command to define the column ordering.