vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hey guys, kinda scratching my head on this one. Each of these insert queries takes about 1 second in QA, but when I decide to loop it 100 times instead of manually inserting it 100 times, it will forever run, and take several minutes just to insert one set. Any ideas as to why? What can I do to make the loop faster? --- declare @x int set @x=1 while @x<100 begin insert into email_groups (groupnum,email_id) select top 10000 @x,email_id from tbl where email_id not in (select email_id from email_groups where groupnum > 1000) set @x=@x+1 end |