Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Enable Trace Flags in SQL Server


Enable Trace Flags in SQL Server

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: Administrators
Points: 52356 Visits: 19006
Comments posted to this topic are about the item Enable Trace Flags in SQL Server

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
espadartico
espadartico
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 171
Steve Jones - SSC Editor - Tuesday, March 14, 2017 9:53 PM
Comments posted to this topic are about the item Enable Trace Flags in SQL Server

Hi Steve,

Great article, I have just one question, I thought that the trace 4199 would turn on the fixes at the optimizer level, not allow you to use the old cardinality estimator.

Thanks.

Steve Jones
Steve Jones
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: Administrators
Points: 52356 Visits: 19006
For which version? For SQL 2016, you shouldn't be using this, as the new cardinality estimator is on.

For 2014, this should help: https://support.microsoft.com/en-us/help/974006/sql-server-query-optimizer-hotfixtrace-flag-4199-servicing-model

Essentially, if you enable this with a database in compat level 120, this turns on the new optimizer for the database.


Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
espadartico
espadartico
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 171
I got confused here, in the article when you are showing the QUERYTRACEON example you say: "As an example, if I want to use the old query optimizer's cardinality from SQL Server 2014", are you refering to a SQL Server 2016 with a compatibility level of 120?
Steve Jones
Steve Jones
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: Administrators
Points: 52356 Visits: 19006
Sorry, that was just an example, and I was thinking one thing and writing the other. This was an article on trace flag changes, not the specifics of what an individual trace flag does, which I didn't verify in this case.

That was the wrong trace flag. 9481 was the one I wanted.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
espadartico
espadartico
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 171
No problem. I just panic a bit since we have that trace flag on our SQL 2014 servers.

Thanks for the explanation.
Koisntantin Taranov
Koisntantin Taranov
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2032 Visits: 462
Hi, Steve, thanks for very useful article (especially for screenshots). Please, add to Enable Trace Flags at Startup section remark:
  • When specifying a trace flag with the -T option, use an uppercase "T" to pass the trace flag number. A lowercase "t" is accepted by SQL Server, but this sets other internal trace flags that are required only by SQL Server support engineers.(Parameters specified in the Control Panel startup window are not read.): https://technet.microsoft.com/en-us/en-en/library/ms190737%28v=sql.120%29.aspx

  • Steve Jones
    Steve Jones
    SSC Guru
    SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

    Group: Administrators
    Points: 52356 Visits: 19006
    Thanks, Konstantin. Added.

    Follow me on Twitter: @way0utwest
    Forum Etiquette: How to post data/code on a forum to get the best help
    My Blog: www.voiceofthedba.com
    Go


    Permissions

    You can't post new topics.
    You can't post topic replies.
    You can't post new polls.
    You can't post replies to polls.
    You can't edit your own topics.
    You can't delete your own topics.
    You can't edit other topics.
    You can't delete other topics.
    You can't edit your own posts.
    You can't edit other posts.
    You can't delete your own posts.
    You can't delete other posts.
    You can't post events.
    You can't edit your own events.
    You can't edit other events.
    You can't delete your own events.
    You can't delete other events.
    You can't send private messages.
    You can't send emails.
    You can read topics.
    You can't vote in polls.
    You can't upload attachments.
    You can download attachments.
    You can't post HTML code.
    You can't edit HTML code.
    You can't post IFCode.
    You can't post JavaScript.
    You can post emoticons.
    You can't post or upload images.

    Select a forum

































































































































































    SQLServerCentral


    Search