SQL Server 2008 - Worth the Wait
Trace flags are used to temporarily enable or disable specific SQL Server database functions, allowing you to change default database behavior or to observe hidden database behavior, and will remain in effect until they are either manually turned off or SQL Server is restarted. Keep in mind that most trace flags are undocumented and Microsoft can and will change the behavior of the flag between SQL Server versions, service packs or hot fixes.
Trace flags can either be set upon startup of SQL Server by using the -Ttrace# option upon SQL Server startup, or by using the DBCC TRACEON console command. Either way, the trace flag will be active until SQL Server is restarted or you use the DBCC TRACEOFF console command to turn the trace flag off.
Trace flags can be a good investigation tool to find that hidden problem or determine how something is really behaving, but it is recommended that you carefully investigate the behavior of a undocumented trace flag before you implement it in your environments (currently only trace flags 230, 1204, 2528, and 3205 are documented in SQL Server 2000 Books Online). A through search of Microsoft's Knowledge Based articles will help in your investigation the current behavior of some trace flags.
The following table is taken from Transact-SQL Language Reference Guide and explains the behavior of a few of the currently documented and undocumented trace flags available for SQL Server 7.0 and 2000.
To find out more about any of the Transact-SQL statements, commands, stored procedures or system tables referenced in this article, please download and purchase a copy of Transact-SQL Language Reference Guide from my website www.TransactSQL.Com.
Copyright 2002 by Randy Dyess, All rights Reserved.