Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.9 KB

schedule-traces.md

File metadata and controls

40 lines (31 loc) · 1.9 KB
title description author ms.author ms.date ms.service ms.topic helpviewer_keywords
Schedule Traces
Schedule Traces
MashaMSFT
mathoma
03/14/2017
sql
conceptual
filters [SQL Server], events
traces [SQL Server]
traces [SQL Server], stopping
events [SQL Server], filters
scheduling traces [SQL Server]
traces [SQL Server], scheduling
stopping traces

Schedule Traces

[!INCLUDE SQL Server] There are two ways to schedule tracing in Microsoft [!INCLUDEssNoVersion]. You can:

  • Enable a trace stop time.

  • Use [!INCLUDEssNoVersion] Agent to schedule a trace.

Specifying a Stop Time

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.

Scheduling Traces by Using SQL Server Agent

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)

sp_trace_setstatus (Transact-SQL)

See Also

Automated Administration Tasks (SQL Server Agent)