You want to prevent long-running queries from executing. How would you do this?

  1. Run the stored procedure set query governor cost limit.

  2. Modify the configuration parameter min memory per query.

  3. Modify the configuration parameter show advanced options.

  4. Modify the configuration parameter query governor cost limit.

  5. Both C and D


Correct Option: E

AI Explanation

To prevent long-running queries from executing, you can modify configuration parameters in SQL Server. Let's go through each option to understand why it is correct or incorrect:

Option A) Run the stored procedure set query governor cost limit - This option is incorrect because running the stored procedure alone will not prevent long-running queries. The query governor cost limit is used to limit the amount of resources (CPU, memory, etc.) that a query can consume, but it needs to be configured and set through the appropriate configuration parameters.

Option B) Modify the configuration parameter min memory per query - This option is incorrect because there is no configuration parameter called "min memory per query" in SQL Server. Therefore, modifying this parameter will not prevent long-running queries.

Option C) Modify the configuration parameter show advanced options - This option is partially correct. The "show advanced options" configuration parameter allows you to view and modify advanced configuration options in SQL Server. However, modifying this parameter alone will not prevent long-running queries.

Option D) Modify the configuration parameter query governor cost limit - This option is correct. The "query governor cost limit" configuration parameter allows you to set a limit on the amount of resources that a query can consume. By modifying this parameter, you can prevent long-running queries from executing.

Option E) Both C and D - This option is correct. Modifying both the "show advanced options" and "query governor cost limit" configuration parameters can help prevent long-running queries from executing. The "show advanced options" parameter allows you to access and modify advanced configuration options, while the "query governor cost limit" parameter sets a limit on query resource consumption.

Therefore, the correct answer is E) Both C and D.

Find more quizzes: