quote: Originally posted by jordanam Maybe someone else can help with that part.
This is a QAD script I use for that sort of stuff:DECLARE @to_search_for VARCHAR(100)SELECT @to_search_for = '%%'SELECT name , SUBSTRING(all_obj_code, text_location - 20, 20) + UPPER(SUBSTRING(all_obj_code, text_location, text_len)) + SUBSTRING(all_obj_code, text_location + text_len, 20) AS text_searched_for , type_desc , created_date , modify_date , all_obj_codeFROM --Relevent code objects (SELECT o.name , PATINDEX(@to_search_for, sm.definition) AS text_location , LEN(REPLACE(@to_search_for, '%', '')) AS text_len , UPPER(SUBSTRING(sm.definition, PATINDEX(@to_search_for, sm.definition), LEN(REPLACE(@to_search_for, '%', '')))) AS text_searched_for , sm.definition AS all_obj_code , o.type_desc , o.create_date AS created_date , o.modify_date AS modify_date FROM sys.sql_modules AS sm INNER JOIN sys.objects AS o ON o.object_id = sm.object_id WHERE sm.definition LIKE @to_search_for) AS objsORDER BY name |