Friday, February 24, 2012

for loops?

Hi all.

Im trying to create a Stored Procedure that inserts multiple rows. But I can't get it to work.

Here's how I would like it to work

for test in (select myid from tblPlayers)
begin
Insert into tblMatches VALUES(test.myid, 2)
end

but obviously it does not work. Any ideas?Insert tblMatches
Select myid, 2 FROM tblPlayers

No comments:

Post a Comment