Hi,
I have 500 store procedures in a sysbase database. Using sql, can i get list of all stored procedures that are using a particular table say "tbl_books"
Thanks
Hi,
I have 500 store procedures in a sysbase database. Using sql, can i get list of all stored procedures that are using a particular table say "tbl_books"
Thanks
How about something along the lines of:
select proc_name from sysprocedures where proc_defn like "%tbl_books%"
Initially I'd try sp_depends.
Syntax: sp_depends objname[, column_name]
For objname you can supply any object name, eg table, view or sproc.
Use something like this:
Select distinct sysobjects.name
, case
when sysobjects.type = 'TR' then 'TRIGGER'
when sysobjects.type = 'P' then 'PROCEDURE'
when sysobjects.type = 'V' then 'VIEW'
else 'UNKNOWN' end type
from sysobjects inner join syscomments
on sysobjects.id = syscomments.id
where syscomments.text like '%tbl_books%'