How do I copy all the data from one column to a new column within the same table.
How do I copy all the data from one column to a new column within the same table.
I'd try something like this:
Set up a test before doing this to your production data
Adjust table structure to include the new field/column
UPDATE myTable
set NewFieldname = OldFieldname
ideally i want to keep both columns until i have the testing on the reporting
Yes, the intent of this set up will keep the data in 2 columns.
Code:Original id oldfield 1 abc 2 xvz With new column id oldfield newfield after the Update query id oldfield newfield 1 abc abc 2 xvz xvz
Cheers Mate, when I run the query I get a message along theline of data violation, could this be due to one of the columns being text andthe second one getting the data from a seconded table.
This was your original question
.How do I copy all the data from one column to a new column within the same table
Where does the second table come from?I just ran a test on a sample database and the query works fine.andthe second one getting the data from a seconded table.
UPDATE TUTOR SET TUTOR.newField = [Name];
YES the new field/column must be the same data type as the original field/column.