Exam 98-364 Topic 4 Question 91 Discussion

Actual exam question for Microsoft's 98-364 exam
Question #: 91
Topic #: 4
You are a database developer for a database named Sales hosted on a SQL Server 2008 server. The Sales database includes the Exams and ExamQuestions tables. If any questions are modified for an exam, you need to ensure that the ExamModifiedDate in the Exams table is updated with the date and time of the update. The ExamQuestions table includes an INSTEAD OF trigger that records when and who last modified each question. Therefore, you decide to create a trigger. You only want the trigger to fire if a constraint violation has not occurred.
Which of the following code will create the trigger to meet your goals?

Suggested Answer: B Vote an answer

The syntax The DML trigger is created on the ExamQuestions table as it should be. AFTER UPDATE is used to ensure that the trigger will only fire after constraints are checked and succeed. In other words, if the UPDATE fails because it does not meet the constraint checks,the trigger will not fire. In contrast, the INSTEAD OF trigger will fire even if the UPDATE would violate constraints since constraints are not checked. While replication is not specifically mentioned in the question, you can specify NOT FOR REPLICATION if the table(s) are involved in replication. The NOT FOR REPLICATION clause indicates that the trigger should not be executed when a replication agent modifies the table that is involved in the trigger.

by Ruth at Jan 25, 2025, 09:55 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10