Click here to Skip to main content
12,304,761 members (64,431 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

3.1K views
Posted

Find particular word or text from the entire stored procedure

, 26 Jan 2012 CPOL
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

You may also be interested in...

Comments and Discussions

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