CREATE proc dbo.p_FindText
@strFind varchar (100),
@varDBName varchar (100) = 'MIBASE'
AS
BEGIN
Declare @varQuery varchar (1000)
select @varQuery =
'SELECT distinct ' +
'name SP_Name, ''sp_helptext '''''' + name + ''''''''SP_HT ' +
'FROM [' + @varDBName + '].[dbo].[sysobjects]
inner join [' + @varDBName + '].[dbo].[syscomments] ' +
'on [' + @varDBName + '].[dbo].[sysobjects].id
= [' + @varDBName + '].[dbo].[syscomments].id ' +
'where xtype = ''P'' ' +
'and text like ''%' + @strFind + '%'' ' +
'order by name '
exec (@varQuery)
END --sp
No hay comentarios:
Publicar un comentario