Note: This question is part of a series of questions that present the same scenario. Each question in the series
contains a unique solution. Determine whether the solution meets the stated goals.
You have a database that contains a table named Employees. The table stored information about the
employees of your company.
You need to implement the following auditing rules for the Employees table:
– Record any changes that are made to the data in the Employees table.
– Customize the data recorded by the audit operations.
Solution: You implement a user-defined function on the Employees table.
Does the solution meet the goal?
A.
Yes
B.
No
Explanation:
SQL Server 2016 provides two features that track changes to data in a database: change data capture and
change tracking. These features enable applications to determine the DML changes (insert, update, and delete
operations) that were made to user tables in a database.
Change data is made available to change data capture consumers through table-valued functions (TVFs).
https://msdn.microsoft.com/en-us/library/cc645858.aspx
I think answer is no.
10
2
No, something like trigger is required here.
13
1
It must be a TRIGGER
12
2
I agree on change data tracking / change capture begin a solution. But this was not even mentioned on the question to be turned on.
The question told us just: “You implement a user-defined function on the Employees table.”
This is NOT ENOUGH. For me is NO.
3
0
Additional link:
https://docs.microsoft.com/en-us/sql/integration-services/change-data-capture/create-the-function-to-retrieve-the-change-data
I think it’s Yes.
6
1
The answer is B – No
Requirement: Record any changes that are made to the data in the Employees table.
UDF cannot record any changes
link placed by nshar describing a function that only retrieving the change of data.
0
0