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

Error when Installing SQL Server 2008 R2 Management Studio

Windows 7 and GoToMyPC - Configure the Domain Group Policy to allow GoToMyPC to send Ctrl-Alt-Del

Technical Team Lead Interview Questions