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 |
|
jylland
Starting Member
27 Posts |
Posted - 2009-12-14 : 18:06:49
|
| How to copy rows and replace them in th same table joined to two other tables ?I three tablestableA, tableB and tableC, tableA and tableB is joined Aid-idA and tableB and tableC is joined Bid-idBI want to copy from TableC the Rows (Cid = 1, Name= Trek1, idB = 1 AND Cid = 2, Name= Trek2, idB = 1 AND Cid = 3, Name= Trek3, idB = 1) joined to tableB Row (Bid = 1, name = scene1, idA = 1) and place them to the tableB Row (Bid =2, Name = Scen2, idA = 1) How do I do this ?TableA Aid Name 1 scan1 2 scan2 3 scan3 4 scan4 TableBBid Name idA1 scen1 12 scen2 13 scen1 2 4 scen1 3 5 scen1 4 TableCCid Name idB1 Trek1 12 Trek2 13 Trek3 14 Trek1 25 Trek2 26 Trek1 37 Trek2 38 Trek1 49 Trek2 410 Trek1 511 Trek2 5The result for table C after insert to tableC, 1 Trek1 12 Trek2 13 Trek3 14 Trek1 25 Trek2 26 Trek1 37 Trek2 38 Trek1 49 Trek2 410 Trek1 511 Trek2 512 Trek1 213 Trek2 214 Trek3 2 |
|
|
ddramireddy
Yak Posting Veteran
81 Posts |
Posted - 2009-12-15 : 10:03:39
|
| I replied to your question at this forum... http://social.msdn.microsoft.com/Forums/en/transactsql/thread/5f148b4c-49a9-4822-93e9-6c880df4a633 |
 |
|
|
|
|
|
|
|