开发者

SQL Server 2008 copy table with changing physical sequence of fields

开发者 https://www.devze.com 2023-01-06 04:19 出处:网络
The task is to copy table1 ( A,C,B ) to table2 ( A,B,C ) Tables effectively identical, the same fields/constraints just physic开发者_如何学编程al sequence of fields is different. Can I do it w

The task is to copy

table1 ( A,C,B )

to

table2 ( A,B,C ) 

Tables effectively identical, the same fields/constraints just physic开发者_如何学编程al sequence of fields is different. Can I do it with standard tools and minimal coding. For bulk copy in this case mapping for each field pair seems to be required.


This seems to be a simple

insert into table2(A,B,C)
select A,B,C from table1


If I've understood your question correctly, you can just copy the table without changes and then change the ordering afterwards. Change the field order by dragging the column in Design mode in SQL Enterprise Manager.

0

精彩评论

暂无评论...
验证码 换一张
取 消