Find String in Stored Proc
Saved my bacon dozens of times when I knew I'd already invented the wheel.
USE YourDB
--this one finds all stored procedures that contain the given text
SELECT OBJECT_NAME(id)
FROM SYSCOMMENTS
WHERE [text] LIKE '%UOM%'
AND OBJECTPROPERTY(id, 'IsProcedure') = 1
GROUP BY OBJECT_NAME(id)
order by object_name(id)
---Note that this works for 'IsTrigger' and 'IsView' as well
|