{ "id": "349bfc81-104e-44ab-afc5-f1cf8adaea6b", "prefix": "plan", "description": "fetch query plan from cache", "body": "SELECT [text]\r\n\t,cp.size_in_bytes\r\n\t,plan_handle\r\nFROM sys.dm_exec_cached_plans AS cp\r\nCROSS APPLY sys.dm_exec_sql_text(plan_handle)\r\nWHERE cp.cacheobjtype = N'Compiled Plan'\r\n\tAND cp.objtype = N'Adhoc'\r\n\tAND cp.usecounts = 1\r\n--AND [text] LIKE '%tblChecksum%'\r\nORDER BY cp.size_in_bytes DESC;\r\n" }