Now that you know why you might want to use it, it’s time to set it up. There are really only 2 steps:
Microsoft Dynamics AX Server Configuration Utility > Tracing Tab
Administration > User Options > SQL
The only bummer with this setup is that it’s per user. If you want to set it up for all users as I often do, it can be time consuming. Thankfully there’s a stored procedure (SET_AX_SQLTRACE) which is included in the Performance Analyzer for Microsoft Dynamics tool that can be used to automate the setup when you have lots of users to configure. This can save a lot of time when setting up tracing globally. Check out the the following for more details on installing the Performance Analyzer for Microsoft Dynamics tool.
Once you have tracing set up, all you have left to do is review the results. You can see the results in the Dynamics AX client (Administration > Inquiries > Database > SQL Statement Trace Log) or query the results directly from the SYSTRACETABLESQL table.
Whenever you log information like this, you need to have some sort of plan for how much data you want to retain. You can purge the data through the client (Administration > Inquiries > Database > SQL Statement Trace Log > Functions > Clear Log), but there’s no logic in that routine to allow you to keep a subset of the trace data. If you want to retain a subset of the trace data based on created date or some other criteria, you’ll have to create your own custom purge process.
Editor’s Note: if you want to check out more great Dynamics AX content by Microsoft Premier Field Engineers, make sure you visit Dynamics AX in the Field.