Reputation: 93297
How can I insert a value from once cell into another cell from the same record for each record in a table, overwriting the original value from the destination? It's a one time query. Using Sql server 2008
e.g.:
origin|destination
------|-----------
1 | A
2 | B
3 | C
to
origin|destination
------|-----------
1 | 1
2 | 2
3 | 3
update into myTable(destination)
?
Upvotes: 0
Views: 2071
Reputation: 992767
Try:
update yourtable set destination = origin;
Without a where
clause, this will apply to every row in the table.
Upvotes: 4