Fetching CLR object execution time

Last Post 15 Nov 2005 10:41 PM by mulhall. 2 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

12 Oct 2005 08:28 PM
Hi All,

I have written two stored procedures one in VB.NET (CLR object) and other in SQL.I want to compare execution time of both the stored procedures,to accomplish this I m firing following query

SELECT @AverageTSQLCPUTime = ISNULL((SUM(STATICS.total_worker_time)/SUM(STATICS.execution_count)),0),

@AverageCLRCPUTime = ISNULL((SUM(STATICS.total_clr_time)/SUM(STATICS.execution_count)),0)FROM sys.dm_exec_query_stats STATICS

CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS SQLTEXT

inner join sys.all_objects ALLOBJECTS on SQLTEXT.objectid =


where ALLOBJECTS.name = 'TestStoredProcedureName';

query runs for SQL stored procedure,but I don't get any results for CLR storedprocedure, bcos there is no query plan entry for CLR stored procedure in sys.dm_exec_query_stats.

So how can I find execution time for CLR objects?????????????

New Member
New Member

15 Nov 2005 10:41 PM
Use a trace and check out batch starting batch completed.
New Member
New Member

24 Feb 2006 02:12 AM
You might also find some things in the new perfmon counters for clr objects. I haven't investigated them but i've seen quite a few.

Acceptable Use Policy