Some flags can only be enabled as global, and some can be enabled at either global or session scope.
Global trace flags are set at the server level and are visible to every connection on the server. Session trace flags are active for a connection and are visible only to that connection. Query trace flags are active for the context of a specific query. In SQL Server, there are three scopes at which trace flags can work: query, session, and global.
Also, as with any configuration change in SQL Server, it is always best to thoroughly test the flag in a non-production environment before deploying. Note that trace flags in this list may have additional considerations regarding their particular usage, so it is advisable to carefully review all the recommendations given here and/or by your support engineer. All documented trace flags and those recommended by Microsoft Support are fully supported in a production environment when used as directed. Trace flags are frequently used to diagnose performance issues or to debug stored procedures or complex computer systems, but they may also be recommended by Microsoft Support to address behavior that is negatively impacting a specific workload. For example, trace flag 3226 is a commonly used startup trace flag which suppresses successful backup messages in the error log. Trace flags are used to set specific server characteristics or to alter a particular behavior.