Jumat, 15 Agustus 2008

seek for dependencies

in sql server 2000, looking for sql dependencies is not that easy.
at least in my humble opinion.

I try to compile from various sources, and this is the result:

/* version 0.90 */
declare @cariIni varchar(150);
set @cariIni = 'vw_d_engagement_all'

--//table 1//
select routine_name, routine_type from information_schema.routines
where routine_definition like '%'+ @cariIni +'%'

--//table 2//
select routine_definition from information_schema.routines
where routine_name like '%'+ @cariIni +'%'

--//table 3//
exec sp_depends @cariIni

--//table 4//
select distinct so.name, so.type
from syscomments sc inner join sysobjects so on sc.id = so.id
where charindex(@cariIni, text) > 0

--//table 5//
exec sp_MSdependencies @cariIni, null, 131527

--//table 6//
exec sp_MSdependencies @cariIni, null, 1053183

expect me to update this procedure in next following days..

Tidak ada komentar: