Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get List of All Stored Procedures that use a particular table 1

Status
Not open for further replies.

Coder7

Programmer
Oct 29, 2002
224
US
Good morning.

I just added an attribute to a table and I'd like a quick way of getting a list of every stored procedure that references that table.

I ran sp_depends with the table name and only got 2 stored procedures back in the list and there are at least 5 stored procedures that use this table, so that's not the right system stored procedure to use to get the info that I need. In the same vein, is there a way to search all stored procedures for a specific attribute?

Any help is appreciated. Thanks and have a great day!
 
hI!

to search for a string in all stored procedures in a database:

select text from dbname..syscomments where text like '%YourString%'

 
Thanks for your idea, vadimg but it just returned:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

 
what SQL version are you running?
i have SQL2K and it works ok... if you have SQL2K, try to play around with the settings (return to grid, return to text... )
 
sorry!!! the one i gave you will only give you the text of the proc... try this to get the names of the procs:

use dbname
go
select object_name(id) From syscomments where text like '%YourString%'
 
That was it - PERFECT!!!!

Thanks so much - have a fantastic weekend!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top