Starting, Pausing, and Stopping Traces

Starting, Pausing, and Stopping Traces

SQL Server 2000

Starting, Pausing, and Stopping Traces

After you have created a template using SQL Profiler, you can start, pause, or stop capturing data using the new trace.

When you start a trace and the server is the defined source, Microsoft® SQL Server™ creates a queue that provides a temporary holding place for captured server events.

Each trace can have multiple producers. A producer collects events in a specific event category and sends the data to the queue. Events are read off the queue in the order in which they were placed. This method is called first-in/first-out (FIFO).

When using SQL Profiler, starting a trace opens a new trace window (if one is not already open), and data is immediately captured. When using SQL Server system stored procedures, you start a trace either manually or automatically every time an instance of SQL Server starts. A soon as the trace is started, data is captured. When a trace has been started, you can modify the name of the trace only.

Pausing a trace prevents further event data from being captured until the trace is restarted. Restarting a trace resumes trace operations. Any previously captured data is not lost. When the trace is restarted, data capturing is resumed from that point onward. When a trace is paused, you can change the name, events, columns, and filters. However, you cannot change the destination(s) to which you are sending the trace or the server connection.

Stopping a trace stops data from being captured. After a trace is stopped, it cannot be restarted without losing any previously captured data, unless the data has been captured to a trace file or trace table. All trace properties that were previously selected are preserved when a trace is stopped. When a trace is stopped, you can change the name, events, columns, and filters.

To run a trace after it has been paused or stopped

Profiler

Transact-SQL

To pause a trace

Profiler

Transact-SQL

To stop a trace

Profiler

To clear a trace window

Profiler

To close a trace window

Profiler

Transact-SQL

Show:
© 2016 Microsoft