I\'m trying to find all references to an object in an SQL Server database.
How can I quickly search? SQL Server Management Studio does not seem to do it. I use http:
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.