A county courts system must append a row to an audit trail table whenever a new docket event is inserted. Which programmability object should they use?
Select an answer to reveal the explanation.
Short Explanation
You can use an AFTER INSERT trigger to write a matching audit row automatically whenever a docket event is inserted. A DEFAULT constraint can stamp a GUID and a SEQUENCE can generate numbers, but neither writes a separate trail row; a columnstore index improves analytical scans rather than auditing inserts.
Full Explanation
When the county courts system must append an audit row for every new docket event, an AFTER INSERT trigger on the docket events table provides automatic, insert-coupled logging that callers cannot easily skip. The trigger runs in the same statement context as the insert, can read the inserted event columns, and can write a corresponding audit trail row with the actor, timestamp, and event payload. This keeps the audit trail in step with every successful insert, including inserts from batch jobs and ad hoc T-SQL, without relying on each caller to issue a second INSERT. A DEFAULT constraint can stamp a column with a GUID or another value, but it cannot create a separate row in an audit table. A SEQUENCE object generates numeric values; it does not copy docket content into a trail or replace insert-time audit logging. A columnstore index improves analytical scan performance, but it does not automatically version or audit docket inserts. Confusing defaults, number generation, or compression with trigger-driven auditing is a common distractor pattern. Exam caveat: AFTER INSERT is appropriate when the base insert should succeed before it is mirrored; INSTEAD OF intercepts a write, such as one made through a view. Triggers add overhead, so keep them lean for high-volume dockets. Practical check: insert one docket event within a transaction, query the audit table for a matching trail row with the same key and a suitable timestamp, then roll back and confirm both rows disappear together.