![]() ![]() For this demo, I am going to set it to 0 and set a trace file size in advance. You can set its value to 2 which will make SQL Server to close the existing trace file and create a new one. If you set the max file size to 100 MB and set trace_file_rollover to 0, the trace can not continue running after filling up 100 MB in the output file. 'max_rollover_files' parameter decides the trace_file_rollover behavior. The example usage of sp_trace_create is below: ![]() In order to schedule this script as a job, we need to make sure that we can control the output trace file size and file name and duration of trace run. Select script uses sp_trace_create extended proc to create trace. Client side File and Table cannot be scriptedĮxec sp_trace_setevent 10, 1, sp_trace_setevent 10, 9, sp_trace_setevent 10, 2, sp_trace_setevent 10, 10, sp_trace_setevent 10, 6, and few other trace eventsĮxec sp_trace_setfilter 10, 0, 7, N'SQL Server Profiler - 91b76b3b-83a8-4d12-80c5-4b611bfc3894' remote server to local drive, please use UNC path and make sure server hasĮxec = sp_trace_create output, 0, N'InsertFileNameHere', NULL will be appended to the filename automatically. filename prefixed by a path, e.g., c:\MyFolder\MyTrace. Please replace the text InsertFileNameHere, with an appropriate
0 Comments
Leave a Reply. |