The most practical way to prepare a Server Side Trace is to use the SQL Server Profiler. First, open Profiler, select the desired Events and fields, put the filter you want.
Then click the “Run” button in the “Trace Properties” window to start Trace and stop it instantly.
To get Trace’s Script, you must follow the path below.
File-> Export-> Script Trace Definition-> For SQL Server 20xx – 20xx…
You can run the generated script directly in the Query Editor after you change the “InsertFileNameHere” value in the Script (please read the descriptions in the Script) and your Server Side Trace will start running.