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)
 searching through proc source TSQL

Author  Topic 

pug2694328
Posting Yak Master

166 Posts

Posted - 2006-11-17 : 12:31:34
I need to locate all procedural TSQL code where I'm using a particular function. Is there a way to run a search through all the PROCs to find occurances of a particular litteral, rather than going into each proc and doing a find?

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-17 : 12:46:32
Why not just run
sp_depends functionname
Go to Top of Page

pug2694328
Posting Yak Master

166 Posts

Posted - 2006-11-17 : 12:54:58
Why not indeed!
That gets me there.

Thanks snSQL!
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2006-11-17 : 13:43:59
Due to inaccuaracies highlighted here in sysdepends I tend to search the text column of syscomments now.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-17 : 14:37:24
I search my source code repository / version control system. With a decent programmers editor that can use RegEx, folder paths, etc. etc.

Kristen
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2006-11-18 : 01:59:38
if you don't have your db scripts under source control (you should) you can use a query similar to this (this is what pootle_flump is suggesting):

http://weblogs.sqlteam.com/brettk/archive/2006/09/22/12454.aspx


SqlSpec - a fast, cheap, and comprehensive data dictionary generator for
SQL Server 2000/2005 and Analysis Server 2005 - http://www.elsasoft.org
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-11-18 : 12:08:28
I posted this a while back:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=32319

It's not vastly different from Brett's code, it's just a stored procedure version. It also suffers from the same shortcomings that are mentioned in the comments.
Go to Top of Page
   

- Advertisement -