• shanjan.sapra (4/29/2014)


    Nice question. But I guess the another answer is also true as an Another alternative to enable/disable the different CE algorithms is the usage of a trace flag. Even with the compatibility level of a database set to ‘SQL Server 2014 (120)’, the trace flag would enforce the usage of the old CE.

    Hence the approach to change to the new CE would be the same and use the trace flag 9481 to enforce the old CE algorithms.

    "You can enable these trace flags at server, session or query level. To enable the trace flag at query level, you use QUERYTRACEON hint documented in KB2801413. "

    From this article:

    http://blogs.msdn.com/b/psssql/archive/2014/04/01/sql-server-2014-s-new-cardinality-estimator-part-1.aspx

    You can not enable these trace flags at only the database level.