Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am optimizing a stored procedure in sql server 2005, and while I know of several ways to measure timing differences, I am not quite sure of a good way to measure memory consumption differences.

How do you measure memory consumption of a stored procedure in sql server 2005? My goal is to be able to convince myself something like "it is about the same as it was" or "it uses X times more memory"

share|improve this question

migrated from Jun 13 '12 at 16:04

This question came from our site for professional and enthusiast programmers.

You are looking for SQL Profiler that tells Reads and Duration – Helper Jun 13 '12 at 15:54

You should be using dynamic management view (sys.dm_exec_query_memory_grants or sys.dm_exec_cached_plans ) to investigate memory consumption . Example:-

Select * from sys.dm_exec_cached_plans where objtype='Proc';

I suggest you read Understanding SQL server memory grant article

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.