How to do a global search for a key word in all the Stored Proc’s for a given DB?
I used the following but I am unable to get the desired results…
SELECT name
FROM sysobjects
WHERE id IN
(
SELECT id
FROM syscolumns
WHERE name = 'loadStatus' COLLATE SQL_Latin1_General_CP1_CI_AS
)
SELECT name
FROM sysobjects
WHERE id IN
(
SELECT id
FROM syscolumns
WHERE name like '%loadStatus%' COLLATE SQL_Latin1_General_CP1_CI_AS
)
Regards
-Vas
Have a look at this link – http://www.sqlservercentral.com/scripts/T-SQL+Aids/31131/ and see if that helps.
The SP in the linked article was written by Prasad Bhogadi and is as follows:
You can use this to create an SP in your database or adapt it for a one-time query.