sqldiag Utility

Command Prompt Utilities

Command Prompt Utilities

sqldiag Utility

The sqldiag utility gathers and stores diagnostic information and the contents of the query history trace (if running.) The 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     [-?] |
    [-I instance_name]
    [ [-U login_ID] [-P password] | [-E] ]
    [-O output_file]
    [-X] [-M] [-C]

Arguments

-?

Displays usage information.

-I instance_name

Specifies the instance of Microsoft® SQL Server™ 2000 on the local server on which to connect. Omit the -I option to connect to the default instance on the local server.

-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.

-O output_file

Redirects sqldiag output to the file named output_file. If the -O option is not specified, the output file name defaults to sqldiag.txt. In this case, the trace file names remain unchanged as blackbox.trc and blackbox_01.trc.

If the -O option is specified, sqldiag renames trace files blackbox.trc and blackbox_01.trc based on the name used for output_file (for example, if output_file is specified as MyDiagnostics.txt, the trace files will be renamed to MyDiagnostics.trc and MyDiagnostics_01.trc respectively).

Use of the -O option enables users to store several sqldiag outputs in the same directory.

-X

Excludes error logs.

-M

Performs DBCC stackdump.

-C

Retrieves cluster information.

Remarks

The sqldiag utility can be run anytime, whether or not SQL Server is started. If SQL Server is running, sqldiag gathers these items:

  • Text of all error logs.

  • Registry information.

  • DLL version information.

  • Output from:
    • sp_configure

    • sp_who

    • sp_lock

    • sp_helpdb

    • xp_msver

    • sp_helpextendedproc

    • sysprocesses
  • Input buffer SPIDs/deadlock information.

  • Microsoft Diagnostics Report for the server, including:
    • Contents of <servername>.txt file

    • Operating System Version Report

    • System Report

    • Processor List

    • Video Display Report

    • Hard Drive Report

    • Memory Report

    • Services Report

    • Drivers Report

    • IRQ and Port Report

    • DMA and Memory Report

    • Environment Report

    • Network Report
  • The last 100 queries and exceptions.

If SQL Server 2000 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® 98 server, the -U and -P options are required, which means sqldiag must be run from a Microsoft MS-DOS® window. The information gathered by sqldiag for a Windows 98 server will be less complete than the information gathered on a Microsoft Windows 2000 or Microsoft Windows NT® server.

For information about where to find or how to run this utility, see Getting Started with Command Prompt Utilities.

See Also

Reporting Errors to Your Primary Support Provider