xp_trace_flushqueryhistory (T-SQL)

Flushes the last 100 Microsoft® SQL Server™ SQL and exception events into the specified file name.

Syntax

xp_trace_flushqueryhistory 'filename'

Arguments
'filename'
Is the file name, including path, of a query history file. If no path is specified, SQL Server writes the query history file to the root directory on the computer running SQL Server.
Return Code Values

0 (success) or >1 (failure)

Result Sets

When filename is valid, xp_trace_flushqueryhistory returns this message.

The command(s) completed successfully.

  

Remarks

When used following xp_trace_setqueryhistory, SQL Server Profiler can open the specified file name to view the last 100 SQL Server SQL and exception events.

Permissions

Execute permissions for xp_trace_flushqueryhistory default to members of the sysadmin fixed server role but can be granted to other users.

See Also
Monitoring with SQL Server Profiler System Stored Procedures (SQL Server Profiler Extended Procedures)
xp_trace_setqueryhistory  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.