views:

82

answers:

1

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)  
?
+4  A: 

Try:

update yourtable set destination = origin;

Without a where clause, this will apply to every row in the table.

Greg Hewgill
thanks .
borisCallens