Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7621485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:12:27+00:00 2026-05-31T04:12:27+00:00

For a given stored procedure, I want the following summary – Tables selected with

  • 0

For a given stored procedure, I want the following summary –

  • Tables selected with column names
  • Tables modified (insert, update or delete) with column names (if update)
  • Any child stored procedure being called with same summary as above two points.
  • Parameters passed

Does anyone know such a T-SQL script to summarize a stored procedure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:12:29+00:00Added an answer on May 31, 2026 at 4:12 am

    You can use sp_help to get information about with parameters and information about the object.

    EXEC sp_help yourProcedure;
    

    Then to get what it is using for tables and columns you can use sp_depends

    EXEC sp_depends yourProcedure;
    

    Here is a useful link that list the sql Object Dependencies

    Or you can also use. But it is only for 2008 and above.

    SELECT * FROM sys.dm_sql_referenced_entities ('dbo.yourProcedure', 'OBJECT');
    SELECT * FROM sys.dm_sql_referencing_entities('dbo.yourProcedure', 'OBJECT');
    

    because sp_depends is deprecated.

    If the store procedure are using dynamic sql. Then the only you have to use:

    sp_helptext yourProcedure 
    

    This will return the content of the procedure.

    If you have Dynamic sql in you store procedure. You could do something like this:

    DECLARE @tbl TABLE(Text VARCHAR(MAX))
    INSERT INTO @tbl
    EXEC sp_helptext yourProcedure
    
    SELECT 
        sysTables.name 
    FROM 
        dbo.sysobjects AS sysTables
    WHERE EXISTS
        (
            SELECT
                NULL
            FROM
                @tbl AS tbl
            WHERE
                tbl.Text LIKE '%'+sysTables.name+'%'
        )
    

    This will return the objects used in the store procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a stored procedure that will create 3 triggers (insert, update, delete) given
In this stored procedure I want to get list of all the tables of
Iam using the following stored procedure for select all child units of the given
I have a stored Procedure (Generate_Insert)which will output an Insert statement as output given
I want to give a user access to a stored procedure, but not to
Given a stored procedure, is there a way to auto generate a Data access
I have a stored procedure that is doing a MERGE. It seems given the
I am using SQL Server 2005. I want to create a stored procedure that
I want to get the collection of errors, caused by a stored procedure, from
I have given an access to stored procedure, which i'm not able to edit.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.