Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Find particular word or text from the entire stored procedure

, 26 Jan 2012
Rate this:
Please Sign up or sign in to vote.
Not necessarily an alternative, but a wrapper. I created it as a quick stored proc, and put it in the master db, so it can be used in any database.Usage: exec fi 'last_name'.USE [master]GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE [dbo].[fi](...

Not necessarily an alternative, but a wrapper. I created it as a quick stored proc, and put it in the master db, so it can be used in any database.

Usage: exec fi 'last_name'.

USE [master]
GO
 
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
 
CREATE PROCEDURE [dbo].[fi]( @StringToSearch varchar(100) )
AS
BEGIN
 
SET @StringToSearch = '%' +@StringToSearch + '%'
SELECT Distinct SO.Name
FROM sysobjects SO (NOLOCK)
   INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
   AND SO.Type = 'P'
   AND SC.Text LIKE @StringToSearch
ORDER BY SO.Name
 
END

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

ednrg
Architect
United States United States
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 26 Jan 2012
Article Copyright 2012 by ednrg
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid