Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

How to get Audit history data using sql

Posted on by 645

I need to create a report using SQL of audit history for a specific entity and a specific field in the entity (old value vs new value) is it possible? I'm using on-premisse 2016

  • Verified answer
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: How to get Audit history data using sql

    Take a look:

    marcuscrast.wordpress.com/.../

    community.dynamics.com/.../using-audit-history-in-ssrs-reports

    Basically you will use ChangeData columns of AuditHistory table.

  • Suggested answer
    Johao Larios Profile Picture
    Johao Larios 1,795 on at
    RE: How to get Audit history data using sql

    Hello, 

    I recommend you use the SDK as described here: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/retrieve-and-delete-the-history-of-audited-data-changes 

    If you want more info about the audit table, you could check here: 

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/entities/audit

    My recommendation is use the SDK.


    Regards

  • Verified answer
    Marco.P Profile Picture
    Marco.P 2,405 on at
    RE: How to get Audit history data using sql

    Hi,

    yes, it's possible.

    Here's a link to help you write down a query to extract data:

    https://community.dynamics.com/crm/b/mscrmcustomization/posts/ms-crm-audit-database-table-details

    Also you can use some XrmToolbox plugin such as :

    https://www.xrmtoolbox.com/plugins/AuditHistoryExtractor/

    https://www.xrmtoolbox.com/plugins/MESquare.XrmToolBox.AuditExplorer/

    https://www.xrmtoolbox.com/plugins/BDK.XrmToolBox.UserAuditViewer/

    Hope it helps,

    Marco

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans