| title | Extract a Script from a Trace | |
|---|---|---|
| titleSuffix | SQL Server Profiler | |
| description | Learn how to extract Transact-SQL events from a trace file or table in SQL Server Profiler and save them as a Transact-SQL script file. | |
| author | rwestMSFT | |
| ms.author | randolphwest | |
| ms.date | 06/05/2025 | |
| ms.service | sql | |
| ms.subservice | profiler | |
| ms.topic | how-to | |
| ms.collection |
|
[!INCLUDE SQL Server Azure SQL Managed Instance]
This article describes how to extract [!INCLUDE tsql] events from a trace file or table and save them as a [!INCLUDE tsql] script file by using [!INCLUDE ssSqlProfiler].
-
Open a trace file or table that contains [!INCLUDE tsql] events that you want to save to a [!INCLUDE tsql] script file. For more information, see Open a trace file (SQL Server Profiler) or Open a trace table (SQL Server Profiler).
-
On the File menu, point to Export, point to Extract SQL Server Events, and then select Extract Transact-SQL Events.
-
In the Save As dialog box, type a name for the [!INCLUDE tsql] file, and select Save.