如何在SQL Server2005中更改列顺序 [英] How to alter column order in SQL server2005

查看:120
本文介绍了如何在SQL Server2005中更改列顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用 SqlBulkCopy 将所有表数据(访问表,表名称称为 Access_table )复制到SQL中的等效表中(表名称称为 SQL_tab > le).

SQL_table中列的顺序与Access_table不同.
我需要更改SQL_table中列的顺序以使其与Access_table中的列相同.

我们是否有任何直接查询来对SQL中的列进行排序?



还有其他解决方案吗?

提前谢谢您.


问候,
JoyJhonson

Hello All,

I am using SqlBulkCopy to copy all table data( Access table, say table name as Access_table) to equivalent table in SQL(say table name as SQL_table).

The order of colums in SQL_table is not same as Access_table.
I need to alter order of colums in SQL_table to make same as it is in Access_table.

Do we have any direct query to order colums in SQL?

Or

Any other solution??

Thank you in advance.


Regards,
JoyJhonson

推荐答案

数据库中列的物理顺序没有任何值.您只需要更改SELECT SQL查询并按所需顺序排列即可.

无论如何,这是一篇对您来说可能很有趣的文章.

http://blog.sqlauthority.com /2008/04/08/sql-server-change-order-of-column-in-database-tables/ [
The physical order of Columns in the database doesn''t have any value. You just need to change the SELECT SQL query and put the order you want.

Anyways, here is an article which might be interesting for you.

http://blog.sqlauthority.com/2008/04/08/sql-server-change-order-of-column-in-database-tables/[^]


打开sql server management studio的设计视图中的sql表,然后使用鼠标以所需的顺序选择并拖放列..
Open the sql table in design view in sql server management studio and use your mouse to select-drag-drop the columns in the order you want..


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

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