Technical Article

Find strings in a stored procedure

,

Really simple... it returns a list of stored procedure names that contain the passed in string.

Useful for finding all stored procedures that call another specified stored procedure.

Call with the following command:

exec usp_functions_findinUSP @str='sp_lastmodified'

create PROCEDURE usp_functions_findInUSP
@str varchar(500)
AS

set @str = '%' + @str + '%'

select O.name from sysComments  C
join sysObjects O on O.id = C.id
where O.xtype = 'P' and C.text like @str

Rate

3.5 (2)

You rated this post out of 5. Change rating

Share

Share

Rate

3.5 (2)

You rated this post out of 5. Change rating