SQL statement trace log (form)

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Click System administration > Inquiries > Database > SQL statement trace log.

Use this form to view and analyze trace entities stored in the SysTraceTableSQL table.


This form is available only if both the SQL trace option and the Table (database) option are selected in the Options form.

The following tables provide descriptions for the controls in this form.





Details about the trace entities, such as when they were created and by whom, the time it took to execute them, the type of trace, and the code that they were generated from.


General information about the Transact-SQL statement, such as the number of records that are affected, their size, the number of records retrieved for every fetch, reuse of the statement, statement ID, and connection ID.


A description of the trace event, the SQL statement involved, and any additional information.


The call stack that resulted in the trace incident.


All the tables that are referenced by the trace entry. The tables are listed by their Application Object Tree (AOT) names.




Edit source code

Edit the code in the Microsoft Dynamics AX code editor.


Access the Import, Export to, and Clear log options.




Created date and time

The date and time when the event was logged.


The user who created the event.

Execution time

The time that is spent executing the event. Execution time is in milliseconds.

Trace type

The object trace type: multiple SQL statement, query time, error, synchronize, deadlock, or warning.


The numeric trace code that is specified by the trace event—for example, SQL error code or warning number.

Large objects included

If this option is selected, large objects from container or memo data type fields are returned by the statement.

More data

If this option is selected, more data is available after the statement is executed.

Records affected

The number of records in the database that are affected by the operation specified in the statement.

Record size

The amount of memory that is needed for Microsoft Dynamics AX to handle one record from the result set for this statement.

Records per fetch

The number of rows that are fetched during each Fetch operation.

Selected for update

If this option is selected, the statement was executed to select records for an update operation.

Selected within transaction

If this option is selected, the statement was executed from within a transaction.


The number of times the statement is reused.

Statement ID

The internal identifier for the statement that is being traced.

Statement type

The type of statement: insert, update, or delete.

Connection type

The type of database connection used. There are six types of connections:

  • Client – Connection from a client for performing a transactional operation.

  • Read-only – Connection from a client for performing non-transactional operations (typically browsing data in a form).

  • Server – Connection from Microsoft Dynamics AX to generate record IDs.

  • User – Application (X++)–controlled connection that is created by using the UserConnection class.

  • ODBC – Application (X++)–controlled Open Database Connectivity(ODBC) connection that is created by using the OdbcConnection class.

Database session ID

The session ID of the Microsoft SQL Serverprocess that executed the statement. This ID is also shown in the Online users form.

Connection ID

The identification number of the database connection on which this statement was executed.


The Transact-SQL statements in the query.


The description of the error from the database.


Additional details about the specific trace log entry.

Table ID

The identification number of the table.

Table name

The unique name of the table.

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).