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 |
magmo
Aged Yak Warrior
558 Posts |
Posted - 2011-09-30 : 04:45:00
|
HiI need to iterate all ID from tableA and insert into tableB based on that ID, can someone show me how?tableAUIDtableBID, UID, NIDlike this..INSERT INTO tablea (UID,NID) VALUES (UIDfromtableA, 77)So the UIDfromtableA is the ID that will change depending on the iteration, and the NID is a fixed value |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-30 : 04:57:54
|
[code]INSERT INTO tableB (UID,NID)SELECT UIDfromtableA, 77 FROM tableA[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2011-09-30 : 06:01:38
|
Great, Thanks! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-30 : 06:05:08
|
wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|