| title | Create a Transact-SQL Script for Running a Trace | |
|---|---|---|
| titleSuffix | SQL Server Profiler | |
| description | Find out how to create a Transact-SQL script from an existing trace file or table in SQL Server Profiler. | |
| author | rwestMSFT | |
| ms.author | randolphwest | |
| ms.date | 03/01/2017 | |
| ms.service | sql | |
| ms.subservice | profiler | |
| ms.topic | how-to | |
| ms.collection |
|
[!INCLUDE SQL Server Azure SQL Managed Instance] This topic describes how to create a Transact-SQL script from an existing trace file or table by using [!INCLUDEssSqlProfiler].
-
Open a trace file or table. For more information, see Open a Trace File (SQL Server Profiler) or Open a Trace Table (SQL Server Profiler).
-
On theFilemenu, point to Export, point to Script Trace Definition, and then click the version that corresponds to the server you want to trace.
-
In the Save As dialog box, enter a name for the script file, and then click Save.
SQL Server Profiler Templates and Permissions
SQL Server Profiler