Domanda

I found a query in the plan cache that needs parameterizing. Not sure which app created this query. Is there a good way in SQL to track down the app that put a given query in cache?

sql2014

È stato utile?

Soluzione

No, information about what sent the query to the server (user, application, IP, etc.) isn't stored in the plan cache or Query Store, or associated views.

You can catch that information while a query is running using sp_WhoIsActive, or logging it to a table.

If you have a good monitoring tool, it may have gathered that information. If you have a bad one, it probably didn't.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a dba.stackexchange
scroll top