Hi All,
I have a stored procedure, I want to know the name of the tables and views use in that stored procedure, can any one suggest how can I do so.
Thanks in advance.
Hi All,
I have a stored procedure, I want to know the name of the tables and views use in that stored procedure, can any one suggest how can I do so.
Thanks in advance.
You can use sp_depends
but this depends on the dependency information being up to date.
Running sp_refreshsqlmodule
on all objects in the database can update this if there is any missing dependency information.
select
so.name,
sc.text
from
sysobjects so
inner join syscomments sc on so.id = sc.id
where
sc.text like '%ROLES%'-- name of the table