• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

System table and Stored Procedure

How can I find the list of  stored procedures which are using a certain table in database?
I have 100 SPs in one database and I am looking for the SPs which are using a table called"Patients".. Is there a system table that has this kind of information in SQL server 2005 so that I don;t have to open up each SP one by one?
0
jung1975
Asked:
jung1975
  • 2
2 Solutions
 
ksaulCommented:
declare @table varchar(256)
set @table = 'yourtable'

select name
from sysobjects o
inner join syscomments c on o.id = c.id
where c.text like '%' + @table + '%'
and o.type = 'p'
0
 
ksaulCommented:
In SQL Management Studio you can also get a list of sps using a table if you right click the table in the Object Explorer and select "View Dependencies"
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now