Bill Barnett's blog

Visual Studio Team System - Web and Load Testing

Deleting old load test results

Load testers sometimes need to clean up old load test results from the VSTS load test results store.   The following SQL script deletes all load test results older than two weeks (though the timeframe is easily changed).

If you have a lot of results, this could take a while to run.  I would recommend that you do not run this script while a load test is running as we have seen this cause the load test to timeout while trying to write to the database.

-- This script deletes all load test run older than two weeks
-- To change the timeframe, change the number of days from 14 to the desired number

USE LoadTest
DECLARE @LoadTestRunId int
DECLARE OldLoadTestsCursor CURSOR FOR
    SELECT LoadTestRunId FROM LoadTestRun WHERE datediff(dd, StartTime, getdate()) > 14

OPEN OldLoadTestsCursor
FETCH NEXT FROM OldLoadTestsCursor INTO @LoadTestRunId

WHILE @@FETCH_STATUS = 0
BEGIN
    EXEC Prc_DeleteLoadTestRun @LoadTestRunId
    FETCH NEXT FROM OldLoadTestsCursor INTO @LoadTestRunId
END

CLOSE OldLoadTestsCursor
DEALLOCATE OldLoadTestsCursor

 

Published Thursday, February 09, 2006 9:27 PM by billbar@microsoft.com

Comments

 

Rob Caron said:

There’s been a lot of attention lately on Team Foundation Server as it gets ready to ship. But...
February 21, 2006 11:34 PM
 

Visual Studio Team System (VSTS) Blog said:

All tasks that should be performed on a regulary basis are listed here.

Deleting old load test results (via...
February 22, 2006 1:10 PM
 

Lorenzo Barbieri @ UGIblogs! said:

May 22, 2006 4:17 PM
 

Visual Studio Team System (VSTS) Blog said:

All tasks that should be performed on a regulary basis are listed here. Deleting old load test results

January 31, 2007 10:02 AM
 

eoftedal said:

Thanks you. Just what I needed.

March 16, 2007 4:51 AM
 

smtripathi99 said:

hi,

it gives error could not locate loadtest database in sysdatabases.

sneh,

smtripathi99@hotmail.com

May 25, 2007 8:52 AM
 

Ed Glas's blog on VSTS load testing said:

Visual Studio Team System for Testers Content Index for Web Tests and Load Tests Getting Started Online

March 17, 2008 12:56 PM
 

BennyKusman said:

IS THE time taken is long ? seems for me it takes forever

February 24, 2009 6:38 AM
 

Bill Barnett s blog Deleting old load test results | Cellulite Creams said:

June 9, 2009 9:40 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker