Microsoft Log Parser

I use Microsoft’s Log Parser to collect events that happened in the time surrounding job failures in case they contain helpful data. All the examples of doing this from within SQL Server require you to put the folder containing the Log Parser executable in the server’s PATH environment variable, and you have to bounce SQL Server to get it pick up the change. When the operations team forgets to install it during the server configuration, you can’t just bounce a production server in the middle of the day when you find out.

I wished therefore not to use an environment variable. I tried specifying the full path to the executable in my call to xp_cmdshell, with and without quotes. No dice. I finally hit upon using the DOS “short names” (the ancient 8.3 names from the bad old days of Windows), which works.

Presuming the default installation location (c:Program FilesLog Parser 2.2), the DOS short path is

c:PROGRA~1LOGPAR~1.2LogPar~1.exe

on an x86 server, and

c:PROGRA~2LOGPAR~1.2LogPar~1.exe

on an x64 server (Progra~2 is the “Program Files (x86)” directory).

Leave a Reply

Your email address will not be published. Required fields are marked *


*