DBCC TRACEON
enables trace flags
What changes
- Input
- trace flag numbers
- Output or change
- session or global trace flags
Syntax at a glance
DBCC TRACEON ( trace# [ , ...n ] [ , -1 ] ) [ WITH NO_INFOMSGS ]
Work example
A supported diagnostic requires a documented trace flag in a controlled test.
Check SQL Server version guidance, scope, restart behavior, and rollback before enabling a flag.
Check your work Only the approved flag is active at the intended scope and the test has a stop condition.
Open Microsoft Learn for full syntax, permissions, and details for your version.