I have seen many articles that explain how to search for text in stored procedures, but being a noob at T-SQL, I need some help.
What I do now is use this query "exec sp_depends table_name" and I look through all the stored procedures manually! I have around 1000 tables with 100s of stored procedures! So How can I use this:
exec sp_depends a_table_name with this:
CREATE PROCEDURE Find_Text_In_SP
SET @StringToSearch = '%' +@StringToSearch + '%'
SELECT Distinct SO.Name
FROM sysobjects SO (NOLOCK)
INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
AND SO.Type = 'P'
AND SC.Text LIKE @stringtosearch
ORDER BY SO.Name