There are several techniques that can be used to see the SQL code that is being executed by Dynamics GP, this article discusses how to turn on Dex SQL logging