How to get the list of all stored procedures using a specific table

Big projects with a lot of stored procedures can be a mess to maintain.

If you change one field in a table, you have to check if there is no side effect in the stored procedures using this table.

This “sp_depends” system stored procedure can help you finding your stored procedures using the table you modified.

Just create a new query, type


EXEC sp_depends @objname='tableName'

(replace “tableName” by the name of your table)

then execute.

result example :

example result

example result

Incoming search terms:

  • how can i get table in stored procedure
  • to get list of stored procedures using specific table

About Sam Beauvois

Application Developer, .NET enthusiast since 2004, I'm interested in technology watch, usability, code quality, patterns & practices, UX, ...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>