Solved

System table and Stored Procedure

Posted on 2007-03-26
2
186 Views
Last Modified: 2010-03-19
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
Comment
Question by:jung1975
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
ksaul earned 500 total points
ID: 18793511
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
 
LVL 10

Assisted Solution

by:ksaul
ksaul earned 500 total points
ID: 18793536
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question