-- -- this script does a cpu bound join from a 1000 row table, and goes to sleep for a random small time -- use mytest go DECLARE @counter int DECLARE @now datetime declare @effe float declare @effe2 as int SET @counter = 1 WHILE @counter < 20 BEGIN SELECT COUNT(*) FROM t1000 a INNER LOOP JOIN t1000 b ON b.c1 = a.c1 option (maxdop 1) SELECT @effe = cast (RAND()* 1 as float) select @effe=@effe/10000 select @now=cast (@effe as datetime) waitfor delay @now select @counter=@counter+1 END GO