You deploy a database by using SQL Server 2014. The database contains a table named Table1.
You need to recommend a solution to track all of the deletions executed on Table1. The
solution must minimize the amount of custom code required.
What should you recommend?
A.
Change data capture
B.
Statistics
C.
A trigger
D.
Master Data Services
Explanation:
Change data capture is designed to capture insert, update, and delete activity applied to
SQL Server tables, and to make the details of the changes available in an easily consumed
relational format. The change tables used by change data capture contain columns that
mirror the column structure of a tracked source table, along with the metadata needed to
understand the changes that have occurred.
A
I pick C – A Trigger.
I believe a trigger is a more appropriate solution here since we’re only required to track deletions while CDC will track all changes (Insert, Update & Delete operations) and CDC is an Enterprise feature.
A is the right answer due to “the solution must minimize the number of custom code required.”
Use Database;
Exec sys.sp_cdc_enable_db;
Go