Audit Sql Table Changes. Beginning in SQL Server 2008 Enterprise you can also set up automatic auditing by using SQL Server Audit. You can use several methods of auditing for SQL Server as described in Auditing Database Engine.
However the actual changed data is not readily available for reversing the unwanted action. In the Audit destination dropdown menu you can choose to write the SQL audit trail to a file or to audit events in the Windows Security log or Application event log. Tracking changes in data over time is a common problem and deciding on your approach relies on answering questions such as Do I want to track every field or just some fields Does it need to be live or is it okay to detect changes within a period of time and What audit.
Im using on-premisse 2016 Development Customization SDK Microsoft Dynamics CRM 2016.
Command string CD Create object CO User profile changes CP. The guidance on setting this up is well documented here. Insert into audit table_name old_content new_content select table_name case when dtable_id is null then null else select d for xml raw end case when itable_id is null then null else select i for xml raw end from inserted as i full outer join deleted as d on itable_id dtable. Im using on-premisse 2016 Development Customization SDK Microsoft Dynamics CRM 2016.