• Toreador (5/15/2014)


    Whatever the truth about the trace flags, I disagree with the answer.

    In my opinion, the best way to test the behaviour of a particular database version is on a database that is actually set to that version. Relying on compatibility levels, flags, etc, is relying on there being no bugs in how the emulation has been coded. The only way to be certain of your results (and hence the best way of doing it) is to create a copy of your database that is set to the appropriate version and compatibility level.

    In that case you seem to be reading a different question from the one I'm reading. The question I saw was about testing specific queries using the new cardinality estimator, rather than testing all the queries in a database.

    You probably wouldn't want to test all of them, because there are some queries that you won't want the new estimator to handle until the bug has been fixed - see for example sql-server-2014-cardinality-estimation-regression - so it's perfectly reasonable to think about testing specific queries rather than the whole kit and caboodle.

    Tom