Contents

A good tip of using Excel to analyse INSERT INTO statement captured in a Trace file

Contents

More than often, you will come across INSERT INTO statements when analysing D365FO trace files.

Below is a good trick to know which values that the system was trying to insert into the tables.

First, copy everything from the statement (click on the Code section > Ctrl + A > Ctrl + C).

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-1.png
copy the query

Paste the script into Excel.

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-2.png
Paste to Excel

Remove any empty rows.

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-3.png
Remove the empty rows

Find the VALUES keyword (usually after RECID). Insert a new row right below that row you found and cut the VALUES part to it.

Before

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-4.png
Values part before

After

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-5.png
Values part after

Copy from VALUES to the end of the script (Choose the VALUES cell > Shift + Ctrl + Down Arrow).

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-6.png
Copy the part

Paste the copied values to any next columns, starting from the row where the very first column of the table appears.

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-7.png
Move the part

There, you can look for the columns with their inserted corresponding values.

For example:

  • ExpandID = ‘0’

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-8.png
ExpandID

  • RecID = ‘5637233827’

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-9.png
RecID

  • ForecastEntryNumber = ‘PAU-000063760’

/2020-06-30-a-good-tip-of-using-excel-to-analyse-insert-into-statement-captured-in-a-trace-file/Pic3-10.png
ForecastEntryNumber