You are creating a table named Orders.
You need to ensure that every time a new row is added to the Orders table, a user-defined
function is called to validate the row before the row is added to the table.
What should you use?
More than one answer choice may achieve the goal. Select the BEST answer.
A.
A data manipulation language (DML) trigger
B.
A DEFAULT constraint
C.
A Data Definition Language (DDL) trigger
D.
A CHECK constraint
E.
A FOREIGN KEY constraint
Explanation:
http://www.techrepublic.com/blog/programming-and-development/comparing-sqlserverconstraints-and-dmltriggers/402
http://msdn.microsoft.com/en-us/library/ms178110.aspx
Is CHECK constraint really the best option when a whole row needs to be validated instead of one column?
CHECK seems to be the best option. It can check the whole row.
I think the best answer for the above scenario is a DML Trigger!!
Oh no!! Check constraint it is!!