Seeing the transaction group command that is being sent to SQL in the gateway logs

Does anyone know if there is a way to see the actual query that a transaction group submits? I keep randomly getting a unique key constraint error from a transaction group that is only triggering once per the change of a specific tag value that is part of the unique constraint and it should only be incremented from the PLC, so I don’t understand the logic of the situation. I was hoping that if I could get the queries posted to the logs then I could see the timeline of the actions from that specific transaction group and narrow down my error. Any help would be great.