Which SQL Server instance is consuming all my CPU/memory?

For anyone running Windows 2008 (or above), you can simply add the “Command Line” column to the Task Manager view. From there, the instance name will follow the “-s” startup option, for example: C:\…\Binn\sqlservr.exe” –sPREPROD

If you’re on Windows 2000/2003 then it’s not quite as straight forward. You can either get the Process ID from Task Manager, and then query each instance with the following SQL to get the PIDs and match things up:

SELECT @@SERVERNAME, SERVERPROPERTY('ProcessID')

…or the following usually works for me from the command prompt, which gives you the SQL Server instance PIDs, and Command Line strings:

wmic /node:localhost process where name="sqlservr.exe" get ProcessID,CommandLine

Hope this helps…

References:
http://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx

Leave a comment

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