SQL Server Profiler – Disable auto scroll by default

profiler

Is there a way for new traces to start with auto scrolling disabled?

This is the very first thing I do every time I start a trace and I'd like to optimize my workflow, especially since I run multiple traces on numerous servers, and each one starts with this option enabled (even within the same instance of Profiler).

enter image description here

I would be open to an AutoHotKey workaround. For example, I use a script that detects when a window with ID 32770 is opened to auto-type "y" (to change a file extension in Windows Explorer it falsely matches the Outlook Rule name popup window though). Also note that it can take exorbitantly long for Profiler to open, because my machine is underpowered.

P.S. To add insult to injury, if you're too fast going to the menu to disable auto scroll on your new trace, it doesn't let you…

enter image description here

Best Answer

Here you go my good man,

Create the following MyProfiler.vbs file in insert the following code:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "PROFILER.EXE /S <your SQL Server Name> /T Standard"
WshShell.AppActivate "PROFILER.EXE"
WScript.Sleep(5000) 
WshShell.sendkeys "%(WO)", True

Now, run MyProfiler.vbs.

Note:

It takes a few seconds to load Profiler.exe so sleep is set to 5 seconds. Otherwise, the auto-scroll commands will be input into the command window where MyProfiler is running. Cheers...

p.s.

You can run whichever template you prefer. I'm running the SQL Server Standard Template with /T.