SQL Query to identify the tables used in the store procedure


  • HI Team,

    Can you please  help me in identifying the SQL Query or some method to identify the tables used in a store procedure. 

    There are many tables thats been used in the written store procedure , but its practically difficult to identify. Can you pleas  help me with a query or any other meathod 

    thank you


    Monday, January 9, 2017 5:20 AM

All replies

  • Hi,

    You can use sp_depends system stored procedure for this.

    sp_depends 'ProcName'

    You can also view the same from SSMS; Right click on SP name and Select "View Dependency"


    Kindly mark the reply as answer if they help

    • Proposed as answer by Uri DimantMVP Monday, January 9, 2017 6:41 AM
    Monday, January 9, 2017 5:30 AM