You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/import-export/specify-data-formats-for-compatibility-when-using-bcp-sql-server.md
Copy file name to clipboardExpand all lines: docs/tools/sql-server-profiler/filter-events-in-a-trace-sql-server-profiler.md
+48-41Lines changed: 48 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,51 +4,58 @@ titleSuffix: SQL Server Profiler
4
4
description: Find out how to set a filter to limit the events that SQL Server Profiler captures during a trace. Read about the formats required for certain filters.
5
5
author: markingmyname
6
6
ms.author: maghan
7
-
ms.date: 03/01/2017
7
+
ms.date: 04/11/2023
8
8
ms.service: sql
9
9
ms.subservice: profiler
10
10
ms.topic: conceptual
11
11
---
12
12
13
13
# Filter Events in a Trace (SQL Server Profiler)
14
14
15
-
[!INCLUDE [SQL Server Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdbmi.md)]
16
-
17
-
Filters limit the events collected in a trace. If a filter is not set, all events of the selected event classes are returned in the trace output. It is not mandatory to set a filter for a trace. However, a filter minimizes the overhead that is incurred during tracing.
18
-
19
-
You add filters to trace definitions by using the **Events Selection** tab of the **Trace Properties** or **Trace Template Properties** dialog box.
20
-
21
-
### To filter events in a trace
22
-
23
-
1. In the **Trace Properties** or **Trace Template Properties** dialog box, click the **Events Selection** tab.
24
-
25
-
The **Events Selection** tab contains a grid control. The grid control is a table that contains each of the traceable event classes. The table contains one row for each event class. The event classes may differ slightly, depending on the type and version of server to which you are connected. The event classes are identified in the **Events** column of the grid and are grouped by event category. The remaining columns list the data columns that can be returned for each event class.
26
-
27
-
2. Click **Column Filters.**
28
-
29
-
The **Edit Filter** dialog box appears. The **Edit Filter** dialog box contains a list of comparison operators that you can use to filter events in a trace.
30
-
31
-
3. To apply a filter, click the comparison operator, and type a value to use for the filter.
32
-
33
-
4. Click **OK**.
34
-
35
-
**Considerations:**
36
-
37
-
- If you set filter conditions on the **StartTime** and **EndTime** data columns of the Events Selection tab, then make sure that:
38
-
39
-
- The date you enter matches this format: `YYYY/MM/DD HH:mm:sec`.
40
-
41
-
-OR-
42
-
43
-
-**Use regional settings to display date and time values** is checked in the **General Options** dialog box. To view the **General Options** dialog box, on the [!INCLUDE[ssSqlProfiler](../../includes/sssqlprofiler-md.md)]**Tools** menu, click **Option**.
44
-
45
-
-AND-
46
-
47
-
- The date you enter is between January 1, 1753 and December 31, 9999.
48
-
49
-
- If tracing events from the **osql** utility or from the **sqlcmd** utility, always append **%** to filters on the **TextData** data column.
50
-
51
-
## See Also
52
-
[SQL Server Profiler](../../tools/sql-server-profiler/sql-server-profiler.md)
53
-
54
-
15
+
[!INCLUDE [SQL Server Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdbmi.md)]
16
+
17
+
Filters limit the events collected in a trace. If a filter is not set, all events of the selected event classes are returned in the trace output. It is not mandatory to set a filter for a trace. However, a filter minimizes the overhead that is incurred during tracing.
18
+
19
+
You add filters to trace definitions by using the **Events Selection** tab of the **Trace Properties** or **Trace Template Properties** dialog box.
20
+
21
+
## Filter events in a trace
22
+
23
+
1. In the **Trace Properties** or **Trace Template Properties** dialog box, select the **Events Selection** tab.
24
+
25
+
The **Events Selection** tab contains a grid control. The grid control is a table that contains each of the traceable event classes. The table contains one row for each event class. The event classes may differ slightly, depending on the type and version of server to which you are connected. The event classes are identified in the **Events** column of the grid and are grouped by event category. The remaining columns list the data columns that can be returned for each event class.
26
+
27
+
1. Select **Column Filters.**
28
+
29
+
The **Edit Filter** dialog box appears. The **Edit Filter** dialog box contains a list of comparison operators that you can use to filter events in a trace.
30
+
31
+
1. To apply a filter, select the comparison operator, and type a value to use for the filter.
32
+
33
+
1. Select **OK**.
34
+
35
+
**Considerations:**
36
+
37
+
- If you set filter conditions on the **StartTime** and **EndTime** data columns of the Events Selection tab, then make sure that:
38
+
39
+
- The date you enter matches this format: `YYYY/MM/DD HH:mm:sec`.
40
+
41
+
-OR-
42
+
43
+
-**Use regional settings to display date and time values** is checked in the **General Options** dialog box. To view the **General Options** dialog box, on the [!INCLUDE[ssSqlProfiler](../../includes/sssqlprofiler-md.md)]**Tools** menu, select **Option**.
44
+
45
+
-AND-
46
+
47
+
- The date you enter is between January 1, 1753 and December 31, 9999.
48
+
49
+
- If tracing events from the **osql** utility or from the **sqlcmd** utility, always append **%** to filters on the **TextData** data column.
50
+
51
+
> [!NOTE]
52
+
> The checkbox for **Exclude rows that do not contain values** may filter out rows with:
53
+
>
54
+
> - NULL values
55
+
> - Empty strings (which technically are values)
56
+
57
+
while NOT filtering out events where the column itself is not present.
58
+
59
+
## Next steps
60
+
61
+
-[SQL Server Profiler](../../tools/sql-server-profiler/sql-server-profiler.md)
0 commit comments