Administering SQL Server

Maximum File and Data Size

Using the Maximum file size and the Maximum rows options, you can specify the maximum size of the file or table holding the trace information and control the amount of space and resources used by a trace.

If a trace defined to save data to a file is started using SQL Profiler and the file already exists, you can append to or overwrite the file. If you choose to append to the file, and the trace file already meets or exceed the specified maximum file size, you are notified and given the opportunity to either increase the maximum file size or specify a new file. The same is true for trace tables.

Maximum File Size

A trace with a maximum file size specified stops saving trace information to the file after the maximum file size has been reached. The maximum file size option must be used when you are saving trace data to a file. The default maximum file size is 5 megabyte (MB). The file rollover option is enabled by default when you are saving trace data to a file.

There is a limit of 1 gigabyte (GB) for the maximum file size option.

How to set a maximum file size for a trace file

Profiler

Profiler

Maximum Data Size

Specifying a maximum data size in a table makes it easier to run unattended traces. For example, if you need to start a trace that saves trace data to a file and/or a table but want to stop the trace if the file becomes too large, you can do so automatically. By specifying the maximum file size and/or rows, the user can guarantee that the trace file or table will not grow beyond the specified limit.

When the maximum data size is set through the SQL Profiler user interface and the maximum size has been reached, the trace continues to run, but the trace information is no longer recorded. However, by using system stored procedures, you can specify that the trace stops when the maximum data size has been reached.

How to set a maximum table size for a trace

Profiler

Profiler

See Also

sp_trace_create