Solved

System table and Stored Procedure

Posted on 2007-03-26
2
183 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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