Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search a string in all stored procedures / Triggers

Status
Not open for further replies.

parbhani

Technical User
Jul 3, 2002
125
GB
Hi Guys ,

I am on ASE 12.5 on Solaris.

I want to search a string in all the stored procedures and triggers in a database, how can I do that ??

Basically, in one of our tables a column is being updated by a string say 'FUNNY', I want to know from where that is happening ??

Please help.

Regards
 
I think this will work:

declare @database varchar(30),@searchstring varchar(128)

select @database = 'xxx'
select @searchstring = 'hello'

exec ( "select so.name,count(*) from " + @database + "..syscomments sc1," + @database
+ "..sysobjects so where sc1.text like '%" + @searchstring + "%' and so.id=sc1.id group by so.name")


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top