Use:
select object_name(m.object_id), m.*
from sys.sql_modules m
where m.definition like N'%name_of_object%'
...because SYSCOMMENTS
and INFORMATION_SCHEMA.routines
have nvarchar(4000) columns. So if "name_of_object" is used at position 3998, it won't be found. SYSCOMMENTS
does have multiple lines, but INFORMATION_SCHEMA.routines
truncates.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…