Often when we go through an SP which has been wriiten by someone else,
we require the table’s used in the SP.
Following script will return the list of tables used in an SP
by taking SP name as parameter.
select (select name
where schema_id = t.schema_id) +’.’+name
from sys.tables as t
where t.object_id in (select depid
where id in (select s.object_id
from sys.procedures as s
where name like ‘%Employee Sales by Country%’));
Hope this helps…..