Take the 2-minute tour ×
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.

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 stackoverflow.com 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 –  abcdefghi Jun 13 '12 at 15:54

1 Answer 1

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

 
discard

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