sqldiag Utility

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.

Syntax

sqldiag [ [-U login_ID] [-P password] | [-E] ] [-O output_file]

Arguments
-U login_ID
Is the user login ID. Login IDs are case-sensitive.
-P password
Is the password for the specified login_ID. If the -P option is specified at the end of the command prompt specifying password, sqldiag uses the default without password of NULL. Passwords are case-sensitive.
-E
Uses a trusted connection instead of requesting a password. For use with Microsoft® Windows NT® only.
-O output_file
Is the file receiving the sqldiag output (text and trace files). If this option is not specified, Microsoft SQL Server™ uses the default output file name of Sqldiag.txt and Sqldiag.trc.
Remarks

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.

See Also
Reporting Errors to Your Primary Support Provider xp_trace_setqueryhistory
xp_trace_flushqueryhistory  


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