| title | Schedule Traces | Microsoft Docs | |||||||
|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||
| ms.date | 03/14/2017 | |||||||
| ms.prod | sql-server-2016 | |||||||
| ms.reviewer | ||||||||
| ms.suite | ||||||||
| ms.technology |
|
|||||||
| ms.tgt_pltfrm | ||||||||
| ms.topic | article | |||||||
| helpviewer_keywords |
|
|||||||
| ms.assetid | 620b79db-924b-4502-8af3-39efcfca245d | |||||||
| caps.latest.revision | 24 | |||||||
| author | JennieHubbard | |||||||
| ms.author | jhubbard | |||||||
| manager | jhubbard |
There are two ways to schedule tracing in Microsoft [!INCLUDEssNoVersion]. You can:
-
Enable a trace stop time.
-
Use [!INCLUDEssNoVersion] Agent to schedule a trace.
You can specify a trace stop time if you use [!INCLUDEtsql] stored procedures or if you use [!INCLUDEssSqlProfiler]. The stop time must be set when the trace is originally configured.
The best way to schedule traces is to use [!INCLUDEssNoVersion] Agent to start the trace and then specify a trace stop time by using the [!INCLUDEtsql] stored procedure sp_trace_setstatus, or [!INCLUDEssSqlProfiler].
To set an end time filter for a trace
Filter Events Based on the Event End Time (SQL Server Profiler)