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
description: "The sys.fn_xe_file_target_read_file system function reads files created by the Extended Events asynchronous file target."
4
4
author: rwestMSFT
5
5
ms.author: randolphwest
6
-
ms.date: 02/22/2024
6
+
ms.date: 10/10/2024
7
7
ms.service: sql
8
8
ms.subservice: system-objects
9
9
ms.topic: "reference"
@@ -46,7 +46,7 @@ The path to the files to read. *path* can contain wildcards and include the name
46
46
47
47
The path to the metadata file that corresponds to the file or files specified by the *path* argument. *mdpath* is **nvarchar(260)** with no default.
48
48
49
-
In [!INCLUDE [sssql11-md](../../includes/sssql11-md.md)] and later versions, you don't need this parameter. It was retained for backward compatibility, for log files generated in previous versions of SQL Server. Starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)], this parameter can be given as `NULL`, as `.xem` files are no longer used.
49
+
In [!INCLUDE [sssql11-md](../../includes/sssql11-md.md)] and later versions, you don't need this parameter. It was retained for backward compatibility, for log files generated in previous versions of SQL Server. In [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, this parameter can be given as `NULL`, as `.xem` files are no longer used.
50
50
51
51
#### *initial_file_name*
52
52
@@ -73,13 +73,13 @@ Used to specify last offset read previously and skips all events up to the offse
73
73
74
74
## Remarks
75
75
76
-
Reading large result sets by executing `sys.fn_xe_file_target_read_file` in [!INCLUDE [ssManStudio](../../includes/ssmanstudio-md.md)] might result in an error. Use the **Results to File** mode (in [!INCLUDE [ssmanstudiofull-md](../../includes/ssmanstudiofull-md.md)], **Ctrl+Shift+F**) to export large result sets to a human-readable file, to read the file with another tool instead.
76
+
Reading large result sets by executing `sys.fn_xe_file_target_read_file` in [!INCLUDE [ssManStudio](../../includes/ssmanstudio-md.md)] might result in an error. Use the **Results to File** mode (in [!INCLUDE [ssmanstudiofull-md](../../includes/ssmanstudiofull-md.md)], **Ctrl+Shift+F**) to export large result sets to a human-readable file, to read the file with another tool instead.
77
77
78
78
[!INCLUDE [sql2008-md](../../includes/sql2008-md.md)] and [!INCLUDE [sql2008r2](../../includes/sql2008r2-md.md)] accept trace results generated in XEL and XEM format. [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)] Extended Events only support trace results in XEL format. We recommend that you use [!INCLUDE [ssManStudio](../../includes/ssmanstudio-md.md)] to read trace results in XEL format.
79
79
80
80
### Azure SQL
81
81
82
-
In [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)] or [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], store `.xel` files in Azure Blob Storage. You can use `sys.fn_xe_file_target_read_file` to read from extended event sessions you create yourself and store in Azure Blob Storage. For example walkthrough, review [Event File target code for extended events in Azure SQL Database and Azure SQL Managed Instance](/azure/azure-sql/database/xevent-code-event-file).
82
+
In [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)] or [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], store `.xel` files in Azure Blob Storage. You can use `sys.fn_xe_file_target_read_file` to read from extended event sessions you create yourself and store in Azure Blob Storage. For example walkthrough, review [Create an event session with an event_file target in Azure Storage](/azure/azure-sql/database/xevent-code-event-file).
83
83
84
84
If you specify wildcard and/or a path for a local file system, you receive an error message similar to:
85
85
@@ -90,7 +90,9 @@ A valid URL beginning with 'https://' is required as value for any filepath spec
90
90
91
91
## Permissions
92
92
93
-
Requires `VIEW SERVER STATE` permission on the server.
93
+
In [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and previous versions, requires `VIEW SERVER STATE` permission on the server.
94
+
95
+
In [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, requires `VIEW SERVER PERFORMANCE STATE` permission on the server.
0 commit comments