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

Comments

Popular posts from this blog

Drupal - How to display webform node in a block?

Error when Installing SQL Server 2008 R2 Management Studio

Technical Team Lead Interview Questions