title | titleSuffix | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | ms.collection | |
---|---|---|---|---|---|---|---|---|---|---|---|
Run SQL Server Profiler |
SQL Server Profiler |
Learn which programs and menus you can start SQL Server Profiler from and which connection contexts, templates, and filters are used with trace output. |
erinstellato-ms |
erinstellato |
maghan, randolphwest |
05/10/2024 |
sql |
profiler |
conceptual |
|
[!INCLUDE SQL Server Azure SQL Managed Instance]
You can run [!INCLUDEssSqlProfiler] in several different ways, to support gathering trace output in various scenarios. You can start [!INCLUDEssSqlProfiler] from the Windows Start menu, from the Tools menu in [!INCLUDEssDE] Tuning Advisor, and from several locations in [!INCLUDEssManStudioFull].
When you first start [!INCLUDEssSqlProfiler] and select New Trace from the File menu, the application displays a Connect to Server dialog box where you can specify a [!INCLUDEssNoVersion] instance to connect to.
- Select the Windows Start icon or press the Windows key and start to type "SQL Server Profiler 18", or a later version as appropriate. When the SQL Server Profiler 18 tile appears, select it.
- On the [!INCLUDEssDE] Tuning Advisor Tools menu, click SQL Server Profiler.
You can start [!INCLUDEssSqlProfiler] from several locations in [!INCLUDEssManStudioFull]. When [!INCLUDEssSqlProfiler] starts, it loads the connection context, trace template, and filter context of its launch point. [!INCLUDEssManStudioFull] starts each SQL Server Profiler session in its own instance, and Profiler continues to run if you shut down [!INCLUDEssManStudioFull].
- In the [!INCLUDEssManStudioFull] Tools menu, click SQL Server Profiler.
-
In Query Editor, right-click and then select Trace Query in SQL Server Profiler.
[!NOTE]
The connection context is the editor connection, the trace template is TSQL_SPs, and the applied filter is SPID = query window session ID.
When you start [!INCLUDEssSqlProfiler] in [!INCLUDE ssms20-md] from the Query Editor, the connection context isn't loaded, and a trace isn't automatically configured. You must manually create a trace and start it.
-
In Activity Monitor, click the Processes pane, right-click the process that you want to profile, and then click Trace Process in SQL Server Profiler.
[!NOTE]
When a process is selected, the connection context is the Object Explorer connection when Activity Monitor was opened. The trace template is the default based on the server type, and the SPID equals the session ID for the selected process.
- In Windows Authentication mode, the user account that runs [!INCLUDEssSqlProfiler] must have permission to connect to the instance of [!INCLUDEssNoVersion].
- To perform tracing with [!INCLUDEssSqlProfiler], users must also have the ALTER TRACE permission.
SQL Server Profiler overview
Use SQL Server Management Studio