Re: in sql server is it possible to get the amount of memory used by a stored procedure? e.g. memory usage statistics per stored procedure?



Daniel
See if this helps you


SELECT TOP 25
obj.[name],
i.[name],
i.[type_desc],
count(*)AS Buffered_Page_Count ,
count(*) * 8192 / (1024 * 1024) as Buffer_MB
-- ,obj.name ,obj.index_id, i.[name]
FROM sys.dm_os_buffer_descriptors AS bd
INNER JOIN
(
SELECT object_name(object_id) AS name
,index_id ,allocation_unit_id, object_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.hobt_id
AND (au.type = 1 OR au.type = 3)
UNION ALL
SELECT object_name(object_id) AS name
,index_id, allocation_unit_id, object_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.hobt_id
AND au.type = 2
) AS obj
ON bd.allocation_unit_id = obj.allocation_unit_id
LEFT JOIN sys.indexes i on i.object_id = obj.object_id AND i.index_id =
obj.index_id
WHERE database_id = db_id()
GROUP BY obj.name, obj.index_id , i.[name],i.[type_desc]
ORDER BY Buffered_Page_Count DESC


"Daniel" <softwareengineer98037@xxxxxxxxx> wrote in message
news:%23ituyGQ6HHA.5844@xxxxxxxxxxxxxxxxxxxxxxx
in sql server is it possible to get the amount of memory used by a stored
procedure? e.g. memory usage statistics per stored procedure?



.



Relevant Pages

  • Re: procedure tuning
    ... Pro SQL Server 2000 Database Design - ... >>> INNER JOIN tblVRM ... >>> INNER JOIN tblFDVSourceSurvey ... I am having problems re-writting a stored procedure to run quicker, ...
    (microsoft.public.sqlserver.programming)
  • RE: Strange bug, hard to reproduce - is it known?
    ... > tables used in the query, nor the query itself were changed (I did make ... > particular stored procedure), yet it did work correctly before. ... > tables involved in my test database, using the EXACT same columns, ... > INNER JOIN dbo.GR AS r ...
    (microsoft.public.sqlserver.programming)
  • Strange bug, hard to reproduce - is it known?
    ... tables used in the query, nor the query itself were changed (I did make ... particular stored procedure), yet it did work correctly before. ... tables involved in my test database, using the EXACT same columns, ... INNER JOIN dbo.GR AS r ...
    (microsoft.public.sqlserver.programming)
  • Re: unable to define transformations with a dts using a stored procedure (SQL Server 2000)
    ... the stored proc) ... at the transformations. ... from a stored procedure and output it to the file. ... INNER JOIN CLARITY_EAP as EAP ...
    (microsoft.public.sqlserver.dts)
  • problem invoking stored procedure
    ... I'm trying to invoke a SQL server 7 stored procedure from asp 3.0 and I'm ... PDFLookup.DocId = PDFDocs.DocId inner join PDFCode on PDFLookup.CodeId = ... PDFLookup inner join PDFDocs on PDFLookup.DocId = PDFDocs.DocId inner join ... objDisplayCode.Direction = adParamOutPut ...
    (microsoft.public.inetserver.asp.db)