Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
asifbhura
Posting Yak Master
165 Posts |
Posted - 2008-05-26 : 02:18:03
|
| hi How to copy data from one column(field) to another column(field).I have two column colA & ColBBoth column have data.but i want to replace all ColB data with ColA.it is like this,COLA COLBabcd grfrdfere kieidkfere fkeriebut, I want like thisCOLA COLBabcd abcddfere dferefere fereplease help me |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2008-05-26 : 02:22:22
|
| DECLARE @A TABLE ( COLA VARCHAR(30),COLB VARCHAR(30))INSERT INTO @ASELECT 'abcd', 'grfr' UNION allSELECT 'dfere','kieidk' UNION ALLSELECT 'fere','fkerie'SELECT * FROM @AUPDATE @ASET COLB = COLASELECT * FROM @A |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-26 : 02:22:23
|
| UPDATE YourTable SET ColB=ColA |
 |
|
|
|
|
|