I want to find all the stored procedures that use sp_a. Right-click the sp_a-viewdependencies-select viewobjectsthatdependon [sp_a] and you will find that sometimes the results cannot be listed in all, not all other stored procedures that use sp_a.
I want to find all the stored procedures that use sp_a. Right-click the sp_a-view dependencies-select view objects that depend on [sp_a] and you will find that sometimes the results cannot be listed in all, not all other stored procedures that use sp_a.
That's all.
The stored procedure calls mup_GetA (I erased the project-related names)
You can view objects dependent on mup_GetA through the functions provided by sqlserver graphics manager.
The result is a bit confusing. I didn't list mup_GetB (I used SQL server 2005)
The solution is as follows:
Method 1:
Choose Database Management> right-click Database> tasks> Generate Scripts> .....
Export all stored procedures to the file, and then ctrl + F to find
Method 2:
The Code is as follows:
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '% text %'
AND ROUTINE_TYPE = 'processed'
Replace text with the content you want to find
Method 3:
The Code is as follows:
Select name
From sysobjects o, syscomments s
Where o. id = s. id
And text like '% text %'
And o. xtype = 'P'
Replace text with the content you want to find
Finished