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 s
olution.
A. Add the CHECK constraint to the table structure.
B. Add the DATEPART function to the stored procedure.
C. Add the DEFAULT constraint to the table structure.
D. Add the SYSDATETIMEOFFSET function to the stored procedure.
E. Add the ISDATE
function to the stored procedure.
Explanation:
SYSDATETIMEOFFSET returns a datetimeoffset(7) value that contains the date and time of the computer on which the instance of SQL Server is running.
ISDATE returns 1 if the expression is a valid d
ate, time, or datetime value; otherwise, 0.
References: https://msdn.microsoft.com/en-us/library/bb677334.aspx