Using SQLDIAG.exe

SQLDIAG.exe is a command line tool that collects information about SQL Server and writes it to a text file. It can be useful for documenting or troubleshooting your SQL Server. When you run this command while SQL Server is running, the following information is collected and stored in a text file called sqldiag.txt, which is stored in the \mssql\log folder.

  • The text of all error logs

  • SQL Server registry information

  • SQL Server dll version information

  • The output from these system stored procedures: 

  • sp_configure

  • sp_who 

  • sp_lock 

  • sp_helpdb 

  • xp_msver 

  • sp_helpextendedproc 

  • sysprocesses 

  • Input buffer SPIDs/deadlock information

  • Microsoft diagnostics report for the server

  • The last 100 queries and exceptions (if the query history trace was running)

For more information, see your SQL Server Books Online.