SQL Journey

Journey of SQL Server & Microsoft Business Intelligence

  • Your Email ID:

    Join 263 other followers

  • SQL Journey

  • Top Rated

  • Bookmarks

  • Blog Stats

    • 110,510 hits
  • Get a Freelancer

    (function(d) { var po = d.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = '//static.flnaffiliate.com/build/js/affiliate-sdk.js'; var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(document);

SQL Server – Search Text in Stored Procedure

Posted by Prashant on February 8, 2013

Here is the query to search text in stored procedure definition:

 SET @SearchText = 'Hierarchy'
 o.name AS [Object Name],
 o.type_desc AS [Object Type],
 m.definition AS [Definition],
FROM sys.sql_modules m
INNER JOIN sys.objects
 o ON m.object_id=o.object_id
WHERE m.definition LIKE '%' + @SearchText + '%'
 AND o.name LIKE 'usp_%'

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 263 other followers

%d bloggers like this: