The sqldiag utility gathers and stores diagnostic information and the contents of the query history trace (if running) into \Mssql7\Log\Sqldiag.txt and Mssql7\Log\Sqldiag.trc This output file includes error logs, output from sp_configure and additional version information. If the query history trace was running when the utility was invoked, the trace file will contain the last 100 SQL events and exceptions. sqldiag is intended to expedite and simplify information gathering by Microsoft Product Support Services.
sqldiag [ [-U login_ID] [-P password] | [-E] ] [-O output_file]
The sqldiag utility can be run anytime, whether or not SQL Server is started. If SQL Server is running, sqldiag gathers these items:
If SQL Server is not running, sqldiag skips gathering the input buffer SPIDs information and the diagnostics report. sqldiag must be run on the server itself, not on a client workstation. If sqldiag is executed on a Microsoft Windows® 95/98 server, the -U and -P options are required, which means sqldiag must be run from an MS-DOS® window. The information gathered by sqldiag for a Windows 95/98 server will be less complete than the information gathered on a Windows NT Server.
Reporting Errors to Your Primary Support Provider | xp_trace_setqueryhistory |
xp_trace_flushqueryhistory |