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)
 how to refresh objects when a column chnages

Author  Topic 

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-15 : 17:32:27
Hi friends
I have a column (staffid varchar(5)) in a table staff.it stores our staff info.
our requirements grown we need to increase column length to varchar(10).
there r many stored procs,function etc., that r currently using this field.
my question is what is best way to get list of objects that referencing this column so that i could modify them to reflect new chnage?
--
cheers

Cheers

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-06-15 : 17:46:56
One option:
select so.name,sc.text
from syscomments sc
join sysobjects so on so.id = sc.id
where text like '%staffid%'
Go to Top of Page

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-15 : 17:51:44
thank u ehorn.thats great
does it return all objects sp,views,fucntions?

Cheers
Go to Top of Page

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-15 : 17:53:49
seems i got everything .
thank u very much ehorn :-)

Cheers
Go to Top of Page

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-15 : 17:56:41
just to let u know i found another one
select * from INFORMATION_SCHEMA.ROUTINES where ROUTINE_DEFINITION like '%staffid%'

Cheers
Go to Top of Page
   

- Advertisement -