Is there a way to name or guide your values in an insert statement? eg.
declare @temp TABLE
(
column1 int,
column2 int,
column3 int
)
insert @temp(column1, column2, column3)
Select 1 as column1,3 as column3, 2 as column2
select * from @temp
will return a 3 in column2 when I would like the 2 in column2 and 3 in column3.
EDIT
I am trying to write some dynamic sql mapping code. Different columns map to our data from each vendor. So my plan was to write the insert statement to go and grab all the vendor columns from a mapping table. However, I cannot be sure the columns will come out of the mapping table in the correct order.