Skip to content

Latest commit

 

History

History
67 lines (41 loc) · 4.18 KB

File metadata and controls

67 lines (41 loc) · 4.18 KB
title Run SQL Server Profiler
titleSuffix SQL Server Profiler
description Learn which programs and menus you can start SQL Server Profiler from and which connection contexts, templates, and filters are used with trace output.
author erinstellato-ms
ms.author erinstellato
ms.reviewer maghan, randolphwest
ms.date 06/05/2025
ms.service sql
ms.subservice profiler
ms.topic how-to
ms.collection
data-tools

Run SQL Server Profiler

[!INCLUDE SQL Server Azure SQL Managed Instance]

You can run [!INCLUDE ssSqlProfiler] in several different ways, to support gathering trace output in various scenarios. You can start [!INCLUDE ssSqlProfiler] from the Windows Start menu, from the Tools menu in [!INCLUDE ssDE] Tuning Advisor, and from several locations in [!INCLUDE ssManStudioFull].

When you first start [!INCLUDE ssSqlProfiler] and select New Trace from the File menu, the application displays a Connect to Server dialog box where you can specify a [!INCLUDE ssNoVersion] instance to connect to.

Start SQL Server Profiler

The following sections describe the ways to start SQL Server Profiler.

Start SQL Server Profiler from the Windows Start menu

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.

Start SQL Server Profiler in Database Engine Tuning Advisor

On the [!INCLUDE ssDE] Tuning Advisor Tools menu, select SQL Server Profiler.

Start SQL Server Profiler in SQL Server Management Studio

You can start [!INCLUDE ssSqlProfiler] from several locations in [!INCLUDE ssManStudioFull]. When [!INCLUDE ssSqlProfiler] starts, it loads the connection context, trace template, and filter context of its launch point. [!INCLUDE ssManStudioFull] starts each SQL Server Profiler session in its own instance, and Profiler continues to run if you shut down [!INCLUDE ssManStudioFull].

Start SQL Server Profiler from the Tools menu

In the [!INCLUDE ssManStudioFull] Tools menu, select SQL Server Profiler.

Start SQL Server Profiler from the Query Editor

In Query Editor, right-click and then select Trace Query in SQL Server Profiler.

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 [!INCLUDE ssSqlProfiler] 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.

Start SQL Server Profiler from Activity Monitor

In Activity Monitor, select the Processes pane, right-click the process that you want to profile, and then select Trace Process in SQL Server Profiler.

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.

.NET Framework security

In Windows Authentication mode, the user account that runs [!INCLUDE ssSqlProfiler] must have permission to connect to the instance of [!INCLUDE ssNoVersion].

To perform tracing with [!INCLUDE ssSqlProfiler], users must also have the ALTER TRACE permission.

Related content