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)
 Find column name in code

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-05-06 : 08:13:04
jayanth gadde writes "I want a query to list all the stored procedures which is using/modifying a particular "column_name""

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-05-06 : 08:17:17
This should work:

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

Something like:

sp_findtext 'UPDATE%SET%columnName%='

The procedure will give you procedure name and line number, you'll have to view the code to determine the context and whether it actually meets your criteria. For example, sp_findtext will find code that's been commented out and will not execute.
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2005-05-06 : 08:29:39
I use this little script. The one rob pointed to you does a MUCH better job though.

select so.name as [Object Name]
from sysobjects so,
syscomments sc
where so.id = sc.id
and so.xtype = 'P' --Search just stored procedures
and sc.text like '%@@IDENTITY%' --<<--- column name, table name, whatever object you are looking for
Go to Top of Page
   

- Advertisement -