Vaderman
January 20th, 2006, 09:55 AM
I've got a table that needs altering but this table has existing data, so the premiss is that I back up the data into a tempory table:
select * into #temptable from DataTable
now at this stage I have the data stored. Next I drop a column from DataTable in the usual manner. It is at this point I wish
to move all the data back from #temptable to DataTable minus the dropped column. BUT, using this approach, I would have to declare variables
for each of the columns of data that I wish to migrate over to the amended DataTable. This would also require me to use a loop to get
the rows out from #temptable and migrate them over to DataTable using insert... values. Is this the only approach that I'm left with, or is there a less long-winded way of achieveing this?
Regards
select * into #temptable from DataTable
now at this stage I have the data stored. Next I drop a column from DataTable in the usual manner. It is at this point I wish
to move all the data back from #temptable to DataTable minus the dropped column. BUT, using this approach, I would have to declare variables
for each of the columns of data that I wish to migrate over to the amended DataTable. This would also require me to use a loop to get
the rows out from #temptable and migrate them over to DataTable using insert... values. Is this the only approach that I'm left with, or is there a less long-winded way of achieveing this?
Regards