List of the tables from Stored procedure

srk 41 Reputation points

Hi there,

I was trying to find list of the tables used in stored procedure as we did use the tables in INSERT, UPDATE, IN JOINS , TRUNCATE as well. I would like to get the list of the tables part of above operations please.

Please let me know.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
10,907 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 33,346 Reputation points

  2. Erland Sommarskog 87,186 Reputation points

    There is no straightforward way to do this - you would need to parse the code.

    But for some ideas of what is available in terms of partial solution, see the short story Where Is that Table Used? on my web site.

    0 comments No comments