Friday 13 June 2008

Simulate Server Load

Loop to execute USP_RandomLoad multiple times to simulate a server load -
DECLARE  @CurrentAttempt INT
DECLARE  @TotalAttempts INT
                        
SET @TotalAttempts = 10
SET @CurrentAttempt = 1
                      
WHILE @CurrentAttempt <= @TotalAttempts
  BEGIN
    PRINT CHAR(13) + 'Run ' + CAST(@CurrentAttempt AS VARCHAR(5))
    EXECUTE USP_RandomLoad  
    SELECT @CurrentAttempt = @CurrentAttempt + 1
  END

No comments: