Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted

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/[^]
 
Share this answer
 
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..
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900