I have create a stored Procedure. As you know there are number of stored procedure and its tough to search a text if you want to find by text to know which sp has that text. The small technique is mentioned below.
alter proc usp_find_word
as
begin
select 'anuragggggggggggg'
declare @varrrrrrr varchar(50)
end
--------------------------------------------------------------------------------------------------------
SELECT OBJECT_NAME(object_id), OBJECT_DEFINITION(object_id)
FROM sys.procedures
WHERE OBJECT_DEFINITION(object_id) LIKE '%anuragggggggggggg%'
SELECT OBJECT_NAME(object_id), OBJECT_DEFINITION(object_id)
FROM sys.procedures
WHERE OBJECT_DEFINITION(object_id) LIKE '%@varrrrrrr%'
---------------------------------------------------------------------------------------------------------
Try this too
SELECT *, OBJECT_DEFINITION(object_id) ObjectDefinition
FROM sys.objects
WHERE OBJECT_DEFINITION(object_id) LIKE '%anuragggggggggggg%'
alter proc usp_find_word
as
begin
select 'anuragggggggggggg'
declare @varrrrrrr varchar(50)
end
--------------------------------------------------------------------------------------------------------
SELECT OBJECT_NAME(object_id), OBJECT_DEFINITION(object_id)
FROM sys.procedures
WHERE OBJECT_DEFINITION(object_id) LIKE '%anuragggggggggggg%'
SELECT OBJECT_NAME(object_id), OBJECT_DEFINITION(object_id)
FROM sys.procedures
WHERE OBJECT_DEFINITION(object_id) LIKE '%@varrrrrrr%'
---------------------------------------------------------------------------------------------------------
Try this too
SELECT *, OBJECT_DEFINITION(object_id) ObjectDefinition
FROM sys.objects
WHERE OBJECT_DEFINITION(object_id) LIKE '%anuragggggggggggg%'
No comments:
Post a Comment