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 |
gt6974a
Starting Member
2 Posts |
Posted - 2007-05-22 : 15:33:58
|
I have several rows that I want to reinsert into the same table but change 2 of the column's names.I know there exists a way to do this by looping, I just don't know it. Thanksi.e.insert into tblThisTable userid, username, column_a, column_b values userid = 000, usename = 'newusername' column_a = (select column_a from tblThisTablewhere userid = 111 and username = 'oldusername' column_b = column_b = (select column_b from tblThisTablewhere userid = 111 and username = 'oldusername' |
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
gt6974a
Starting Member
2 Posts |
Posted - 2007-05-22 : 16:21:37
|
that did it, thanks |
 |
|
|
|
|