When a system uses a lot of tables, and there are a lot of stored procedures, when a table in the database deleted a field, then the corresponding stored procedures need to be changed, but we do not know which stored procedures used the field, then what should we do? We can find stored procedures that use the field from one previous document, but this is much more efficient and error-prone, and we can use the following method to find all stored procedures that use a field.
The first method:
Selectobject_name (ID), * fromsyscomments wheretext like '% of the content you want to check
The second method:
The following functions:
[SQL]
SELECT obj. Name stored procedure name, SC. Text Stored procedure content
From syscomments SC
INNER JOIN sysobjects obj on SC. Id = obj.id
WHERE SC. Text like '% of what you want to look for% '
SQL Server finds all stored procedures that use a field