Setting Trace Flags "Permanently" in SQL Server?

Solution 1:

Yep, that'll about do it for you. Using the -T{traceflag} startup parameter, that is.

Solution 2:

Something that I learned the hard way is that you have to have semicolons before each trace flag. For example, if you were enabling logging of deadlock info to file, your example would become...

-dD:\MSSQL10.MSSQLSERVER\MSSQL\DATA\master.mdf;-
eD:\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG;-
lD:\MSSQL10.MSSQLSERVER\MSSQL\DATA\mastlog.l
df;-T7646;-T3605;-T1204;-T1222

Spaces between trace flags cause the later flags to be ignored.