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:
- Open Task Manager
- Switch to the Processes tab
- Find mcshield.exe
- Right-click → Set Priority → Normal
Happy system. Happy me.
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.