Question 6
DP-800 Practice Test
DP-800 Practice Test practice questions, page 2 of 3, with answer review and explanations.
Question 7
You have an Azure SQL database. You need to create a scalar user-defined function (UDF) that returns the number of whole years between an input parameter named @OrderDate and the current date/time as a single positive integer. The function must be created in Azure SQL Database. You write the following code. What should you insert at line 05?
- RETURN DATEDIFF(year, GETDATE(), @OrderDate);
- DATEDIFF(month, @orderdate, GETDATE()) / 12
- DATEPART(year, GETDATE()) - DATEPART(year, @orderdate)
- RETURN DATEDIFF(year, @OrderDate, GETDATE());
Question 8
You have an Azure SQL database. You deploy Data API builder (DAB) to Azure Container Apps by using the mcr.microsoft.com/azure-databases/data-api-builder:latest image. You have the following Container Apps secrets: MSSQL_CONNECTION_STRING that maps to the SQL connection string DAB_CONFIG_BASE64 that maps to the DAB configuration You need to initialize the DAB configuration to read the SQL connection string. Which command should you run?
- dab init --database-type mssql --connection-string “secretref:DAB_CONFIG_BASE64” --host-mode Production --config dab-config.json
- dab init --database-type mssql --connection-string “@env(‘MSSQL_CONNECTION_STRING’)” --host-mode Production --config dab-config.json
- dab init --database-type mssql --connection-string “secretref:mssql-connection-string” --host-mode Production --config dab-config.json
- dab init --database-type mssql --connection-string “@env(‘DAB_CONFIG_BASE64’)” --host-mode Production --config dab-config.json
Question 9
You have a SQL database in Microsoft Fabric that contains a nvarchar (max) column named MessageText. An ID is always contained within the first paragraph of MessageText. You need to write a Transact-SQL query that uses REGEXP_SUBSTR to extract the ID from MessageText. What should you include in the query?
- Apply STRING_ESCAPE(MessageText, ‘json’) before calling REGEXP_SUBSTR.
- Cast MessageText to nvarchar (4000) before calling REGEXP_SUBSTR.
- Add a COLLATE Latin1_General_CS_AS clause to MessageText before calling REGEXP_SUBSTR.
- Run TRY_CONVERT(varchar(max), MessageText) before calling REGEXP_SUBSTR.
Question 10
You have an Azure SQL database that contains database-level Data Definition Language (DDL) triggers, including a trigger named ddl_Audit. You need to prevent ddl_Audit from firing during the next deployment. The trigger object must remain in place. Which Transact-SQL statement should you use?
- ALTER TRIGGER
- ALTER DATABASE
- ALTER SERVER AUDIT SPECIFICATION
- DISABLE TRIGGER
- ALTER DATABASE AUDIT SPECIFICATION