RE:Buscar String en todos los SP de una Db
Alejandro
Te pongo 3 opciones de 3 grandes maestros del SQL, selecciona la que mas te guste:
------ Emilio Boucaou
Declare @objname nvarchar(776)
Create table ##Listado (Objname nvarchar(776))
declare Lista cursor for
Select name from sysobjects
where xtype='P'
open lista
Fetch lista into @objname
while @@fetch_status=0
Begin
if exists(Select 1 from syscomments
where id = object_id(@objname) and encrypted= 0
and Patindex(Upper('%ACA COLOCAS LO QUE QUIERES
BUSCAR%'),Upper(text))<>0)
begin
insert ##listado select @objname
end
Fetch lista into @objname
End
Close Lista
Deallocate Lista
Select * from ##listado
drop table ##listado
------------- Eladio Rincon
select routine_name
from information_schema.routines
where
routine_type = 'PROCEDURE'
and routine_definition like 'tu_texto'
------------- Justing Xiang
Select name
from sysobjects
where type = 'P'
and id in (Select id from syscomments where text like '%..........%')