Querying Microsoft SQL Server 2012/2014 — Question 7

You need to build a table structure for a stored procedure to support data entry from a website form. The website form must meet the following requirements:
✑ Users must validate their age as 18 or older to use the website.
✑ Users who leave the date of birth field blank, or who enter an invalid date, must receive an error message.
Which two actions should you perform? Each correct answer presents part of the solution.

Answer options

Correct answer: D, E

Explanation

The correct actions involve using the ISDATE function to validate the date of birth input and the SYSDATETIMEOFFSET function to manage date and time correctly in relation to the user's age. The other options, such as the CHECK and DEFAULT constraints, do not directly address the requirement to validate and process user input effectively in this context.