Microsoft Exam Questions

ttps://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-2017&#823

Note: This question is part of a series of question

s that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a

question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You support an application that stores data in a Microsoft SQL Server database. You have a query that returns data for a rep

ort that users run frequently.

The query optimizer sometimes generates a poorly-performing plan for the query when certain parameters are used. You observe that this is due to the distribution of data within a specific table that the query uses.

You ne

ed to ensure that the query optimizer always uses the query plan that you prefer.

Solution: You add the KEEPFIXED PLAN query hint to the query.

Does the solution meet the goal?

A. Yes

B. No

Explanation:

KEEPFIXED PLAN forces the query

optimizer not to recompile a query due to changes in statistics. Specifying KEEPFIXED PLAN makes sure that a query will be recompiled only if the schema of the underlying tables is changed or if sp_recompile is executed against those tables.

References: h

ttps://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-2017