Performance testing sql script / stored proc in SQL 2000

  • Someone is sure to say that this is easy but it is beyond me....  I have a stored proc or script that I wish to performance test.  After running it for the first time and making a few improvements I normally down SQL Server and restart it - which is fine since I work on a standalone copy.  How do I get a level playing field if I cannot down SQL Server?    In other words how do I clear any caching that SQL Server is doing and test the script as if it has not been run before?

    Any ideas?

  • there are a couple of dbcc commands that will clear the cache(s) but it does it for the entire server ..

    sp_recompile removes the proc plans from cache.

    dbcc freeproccache clears the cache

    dbcc dropcleanbuffers clears the data cache

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Colin

    Many thanks those two DBCC commands seem to give me reasonably consistent timings now for the same piece of code.

    Thanks for the prompt reply.

    David Putman

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply