Create a SQL trace by using the SQL Profiler

Completed

Another tool developers can use to test performance and diagnose performance issues is the SQL Profiler. You access the Profiler through the SQL Server management studio. Here you can exploit the server-side trace capabilities of the SQL Server Profiler to export a trace definition that you can use to create a collection that uses the Generic SQL Trace collector type.

Note

This tool can only be used on tier 1 Dynamics 365 instances

There are many reasons why you would want to use the SQL Profiler. For example, you may need to see all the long-running queries on the SQL server system, not just the long-running queries in finance and operations apps.

To access and use the SQL Profiler, follow these steps:

  1. In SQL Server Management Studio, open SQL Server Profiler from the Tools menu.

  2. Connect to the database.

  3. In the Trace Properties windows, name your trace.

  4. When you have specified all properties, select Run.

  5. While the SQL Profile trace is running, you perform the process or processes that are of concern. For example, users may be experiencing slowness when adding data to the SalesTable. In this case, you will ask the user to perform the task, while the trace is running.

  6. When the process is complete, stop the trace by selecting the Stop button in the menu.

  7. Now you can analyze the trace by reviewing the trace results. The following screenshot shows what the trace looks like when it is stopped.

    Screenshot of My Trace window when a trace is stopped