October 3, 2006 at 7:17 am
Does anyone have a script (or know of a system stored proc) that will return all of the stored procedures that use a specific table in it?
For example, I want all stored procedures that have Table1 in it?
Thanks,
Michael
October 3, 2006 at 7:33 am
Here's a simple one... the only problem with it is if a table name straddles an 8 k boundry... then it will miss the table name...
--Find name of proc, view, function, etc containing text in DDL
SELECT DISTINCT so.Name, so.Xtype
FROM SYSOBJECTS so,
SYSCOMMENTS sc
WHERE so.ID = sc.ID
AND sc.Text LIKE '%puttablenamehere%'
ORDER BY so.xtype,so.Name
--Jeff Moden
Change is inevitable... Change for the better is not.
October 3, 2006 at 7:36 am
If you want to search for a specific string
http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1131
Prasad Bhogadi
www.inforaise.com
October 3, 2006 at 8:00 am
It worked perfectly!
Thanks,
Michael
October 3, 2006 at 8:15 pm
Outstanding... Thanks for the feedback, Michael.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply