Frage

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

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit dba.stackexchange
scroll top