Why is mcshield.exe Running with High Priority?

tech — tags: , — rohand @ April 25, 2010 2:13 AM

After weeks of putting up with significant disk activity and system slowness, I finally noticed that the McAfee anti-virus On Access Scanner process – mcshield.exe – was running as a High Priority process in Task Manager.

The fix was simple:

  1. Open Task Manager
  2. Switch to the Processes tab
  3. Find mcshield.exe
  4. Right-click → Set Priority → Normal

Task Manager - mcshield.exe

Happy system. Happy me.

List Stored Procedures with Contents in SQL Server

tech — tags: , — rohand @ April 7, 2010 8:47 AM

I needed to get a list of all stored procedures that accessed a specific column in a table. Some stored procedures generated dynamic SQL statements so the View Dependencies feature was not guaranteed to get me the full list.

This query lets me retrieve the name and body of all stored procedures in a database. Adding the filter to look for the specific column is relatively simple.

SELECT              o.Name AS SpName, c.Text AS SpBody
FROM                syscomments c WITH (NOLOCK)
JOIN                sysobjects o WITH (NOLOCK)
ON                  c.ID = o.ID
AND                 o.Type = 'P'        -- Only stored procedures
ORDER BY            o.Name

This query is for SQL Server 2005 but should work across all versions.

©2012 appytizers. All rights reserved.