Sql Server Measuring Query Memory Consumption 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"
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