0

I work on a system that comprises of a SQL Server 2012 DB server that is queried frequently with complex queries. Sometimes these queries take more than 2 or 3 mins to return.

How can I record or log the execution plans for these queries when they run for more than a certain time ( configurable - say 1 mins etc ) ?

Bhaskar
  • 141
  • 1
  • 5

1 Answers1

1

Try using SQL Server Profiler. In SQL Server Management Studio, go to Tools > SQL Server Profiler. It has options to trace which query is running, how long it's running, and you can also specific the time to start and end the trace. It also has option to save the results to a file or in a table.

Peter
  • 309
  • 2
  • 11