DETACH TRACING statement

Use this statement to end a diagnostic tracing session.

Syntax
DETACH TRACING { WITH | WITHOUT } SAVE
Parameters
  • WITH SAVE clause   Specify WITH SAVE to save data any unsaved diagnostic data in the diagnostic tables.

  • WITHOUT SAVE clause   Specify WITHOUT SAVE if you do not want to save any unsaved tracing data.

Remarks

Issue this statement from the database being profiled to stop sending diagnostic information to the diagnostic tables. If you specify the WITHOUT SAVE clause, you can still save the data later—assuming the tracing database is still running and another tracing session has not been started—by using the sa_save_trace_data system procedure. See sa_save_trace_data system procedure.

To see the current tracing levels set for a database, look in the sa_diagnostic_tracing_level table. See sa_diagnostic_tracing_level table.

Note

Tracing information is not unloaded as part of a database unload or reload operation. If you want to transfer tracing information from one database to another, you must do so manually by copying the contents of the sa_diagnostic_* tables; however, this is not recommended.

Permissions

Must have DBA authority.

Side effects

None.

See also
Standards and compatibility
  • SQL/2003   Vendor extension.