Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Search in query analyser

Author  Topic 

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-08-10 : 11:20:43
Hi,

How do I search particular text in my all stored procedure in a database?

Thanks

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-08-10 : 11:24:48
Select B.name, A.text
from yourDb.dbo.syscomments A
Inner Join yourDb.dbo.sysobjects B
where A.text like '%somestring%'

EDIT: Don't try to do anything to these tables... only for research purpose!!!

Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-08-10 : 11:45:29
Hi seventhnight,

I tried your code slightly modifying it with my database name but it throws error

"Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'where'.
"

Is it somthing I missed out from your query?

Thanks
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-08-10 : 13:10:48
oops...forgot the 'On'


Select B.name, A.text
from yourDb.dbo.syscomments A
Inner Join yourDb.dbo.sysobjects B
On A.id = B.id
where A.text like '%somestring%'


Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-10 : 13:23:17
Here, give this a read...

http://weblogs.sqlteam.com/brettk/archive/2004/02/05/841.aspx



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-08-11 : 05:01:10
Thank you all.

It has been very helpful.

Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-11 : 05:11:06
>>Don't try to do anything to these tables... only for research purpose!!!

This will avoid that

Select routine_definition from information_Schema.routines
where routine_definition like '%somestring%'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -