SQL Server 2008 copy table with changing physical sequence of fields
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.
精彩评论