Technical Article

Search for Stored Procedures

,

Allows user to search for stored procedures from the sysobjects table.  Returns the name of the stored procedure with sp_helptext as a prefix.  Useful in development environment where developers need to look up existing stored procedures.

CREATE PROCEDURE dbo.usp_helpname
  @searchname varchar(30)
AS

SELECT 'sp_helptext ' + name 
FROM SysObjects 
WHERE name like '%' + @searchname + '%' AND Type = 'P'
ORDER BY name ASC;

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating