CREATE PROC dbo.sp_find(@LikeSearchstr VARCHAR(255))
AS
/*
Created by: Abhishek Joshi
Created Date: Oct 27 2010
Usage: To find a object stored proc or views that contain specific sttring.
Example
Exec dbo.sp_find 'Orders'
*/
BEGIN
DECLARE @cmd VARCHAR(MAX)
SET @cmd='
SELECT Name,OBJECT_DEFINITION(OBJECT_ID) as Text_Definition
FROM sys.objects
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE ''%'+@LikeSearchstr+'%'''
EXEC(@CMD)
END
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment