Microsoft Fabric Data Engineer Associate DP-700 Practice Question

You author the following T-SQL in a Microsoft Fabric warehouse and receive an error at compile time:

CREATE OR ALTER PROCEDURE dbo.usp_GetSales
    @StartDate  date,
    @EndDate   datetime = DATEADD(day,-7,CURRENT_TIMESTAMP)
AS
    SELECT *
    FROM dbo.Sales
    WHERE SaleDate BETWEEN @StartDate AND @EndDate;

You want callers to be able to omit @EndDate so that it automatically defaults to seven days before the current time. Which modification will resolve the error while preserving this behaviour?

  • Fully qualify the DATEADD function by writing dbo.DATEADD(day,-7,CURRENT_TIMESTAMP) in the parameter list.

  • Delete the default expression and begin the procedure with:

    IF @EndDate IS NULL
        SET @EndDate = DATEADD(day,-7,CURRENT_TIMESTAMP);
    
  • Add the query hint OPTION (ENABLE_VARIABLE_FUNCTIONS = 1) at the end of the SELECT statement.

  • Change the default to a literal value, for example @EndDate datetime = '2024-01-01'.

Microsoft Fabric Data Engineer Associate DP-700
Monitor and optimize an analytics solution
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot