Using SQL Profiler
SQL Profiler is a tool similar to the Client Monitor in NAV. It allows you to create a trace of the T-SQL commands between NAV and SQL issued by a specific user. This recipe will show you the basics of setting up a SQL trace and what to do with the data afterwards.
How to do it...
Go to Start | All Programs | Microsoft SQL Server 2008 | Performance Tools | SQL Server Profiler.
Click on File | New Trace. This will prompt you to connect to a SQL Server.
Once you have connected to the server, you will be presented with the Trace Properties screen.
Here you can set the name of the trace and how you would like to save it. You can also click on the Events Selection tab to choose exactly what types of events and fields you want to record.
When you are satisfied with the setup you can click the Run button. This will begin the trace and you will see an output similar to the following:
You can see the username, reads and writes on the database, execution time, and even the actual query...