I'm running the following query,
SELECT TOP 20
QueryStat.last_execution_time AS [Run Time]
,QueryText.TEXT AS [Query]
FROM sys.dm_exec_query_stats AS QueryStat
CROSS APPLY sys.dm_exec_sql_text(QueryStat.sql_handle) AS QueryText
ORDER BY QueryStat.last_execution_time DESC
and I noticed that I have rows that have something like
(@1 varchar(8000),@2 varchar(8000),etc...)
I also noticed some entries where the only thing that exist is this
I know these might be some code from a dynamic sql stored procedure that I have, but sql_handle should be for a batch or a stored procedure, not for a part of the batch.
Does anyone know why these entries exist as orphans and not in a full batch?
Also, the same query is giving me results as following, but I couldn't the dbid or the object_id to find out whe
View Complete Post