Geeks With Blogs

News

Agha Usman Ahmed JILAWATAN
Another requirement of the day, we need to search text in the sql server procedures. To be more specific I want to find which procedure is using my table named as “table_name”.
So here is the quick query for that.
 
select distinct so.name from sys.objects so inner join syscomments sc on so.object_id = sc.id where so.type = 'p'
and sc.text like '%table_name%'.
 
This will list all the procedures which are using “table_name”.


Note: The query was originally created by Adil Aleem of Ln Technologies.
Posted on Monday, October 27, 2008 5:28 PM | Back to top


Comments on this post: Search Text Inside Stored Procedures

# re: Search Text Inside Stored Procedures
Requesting Gravatar...
Thats what i was searching for. very valuable information.ranked a+
Left by Syed Safiullah Hussaini on Oct 27, 2008 5:38 PM

# re: Search Text Inside Stored Procedures
Requesting Gravatar...
Great work man. it solved my problem.
Left by Hassan Zaheer on Oct 27, 2008 5:43 PM

Your comment:
 (will show your gravatar)


Copyright © Agha Usman Ahmed | Powered by: GeeksWithBlogs.net