Slow Query log

Hi Experts,

Can I log slow queries in file which are located to other directory, Is this is possible in Sql server 2012. Please suggest a way .

Thanks .

It's been a while since I've tried this on SQL Server 2012 but an Extended Event session should work. You capture all RPC Completed and SQL Batch Completed over a certain duration -- I use 1 second. Or maybe 10 seconds.

Hi Graz,

Mean i need to write my batch file to capture slow query and scheduled it with interval of 1 minute or 10 sec.

an extended event session just writes to the file continuously.