nerdexam
Microsoft

DP-300 · Question #12

You have SQL Server on an Azure virtual machine that contains a database named DB1. You have an application that queries DB1 to generate a sales report. You need to see the parameter values from the…

The correct answer is B. Enable Lightweight_Query_Profiling in DB1 C. Enable Last_Query_Plan_Stats in DB1. LAST_QUERY_PLAN_STATS works under the lightweight query execution statistics profiling infrastructure, so we need to ensure both Last_Query_Plan_Stats Lightweight_Query_Profiling is on at database scope (though Lightweight_Query_Profiling is default on at SQL2019 but it can be…

Submitted by skyler.x· Mar 6, 2026Optimize query performance

Question

You have SQL Server on an Azure virtual machine that contains a database named DB1. You have an application that queries DB1 to generate a sales report. You need to see the parameter values from the last time the query was executed. Which two actions should you perform? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

Options

  • AEnable Last_Query_Plan_Stats in the master database
  • BEnable Lightweight_Query_Profiling in DB1
  • CEnable Last_Query_Plan_Stats in DB1
  • DEnable Lightweight_Query_Profiling in the master database
  • EEnable PARAMETER_SNIFFING in DB1

How the community answered

(52 responses)
  • A
    10% (5)
  • B
    71% (37)
  • D
    4% (2)
  • E
    15% (8)

Explanation

LAST_QUERY_PLAN_STATS works under the lightweight query execution statistics profiling infrastructure, so we need to ensure both Last_Query_Plan_Stats Lightweight_Query_Profiling is on at database scope (though Lightweight_Query_Profiling is default on at SQL2019 but it can be turned off as well). https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management- views/sys-dm-exec-query-plan-stats-transact-sql?view=sql-server-ver15

Community Discussion

No community discussion yet for this question.

Full DP-300 Practice