如何在 sql server 2005 中使用 sql 查询更改表中的列顺序? [英] How to change column order in a table using sql query in sql server 2005?

查看:35
本文介绍了如何在 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.

这篇关于如何在 sql server 2005 中使用 sql 查询更改表中的列顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆