Posts

Showing posts from October, 2007

Search objects used in database

Below is the stored procedure which will query the database and find the list of objects which match the search string specified. CREATE PROCEDURE [dbo].[sp_Search_sProcs] @searchText varchar(100) AS SELECT sysobjects.name FROM sysobjects, syscomments WHERE syscomments.id = sysobjects.id and sysobjects.xtype = 'P' AND sysobjects.category = 0 AND syscomments.text LIKE '%' + @searchText +'%' ORDER BY sysobjects.name GO