/****** Object:  StoredProcedure [dbo].[P_TRIGGER]    Script Date: 04/30/2013 17:54:03 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_TRIGGER]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[P_TRIGGER]
GO
CREATE PROCEDURE [dbo].[P_TRIGGER](@TRIGGER VARCHAR (500))   
  
AS  

 SELECT 
	OBJECT_NAME(C.id) Nm_trigger,
	O.NAME Tabela,
	C.[TEXT] Texto
FROM 
	syscomments  C
	INNER JOIN SYS.TRIGGERS  T ON 
	C.ID = T.OBJECT_ID
	INNER JOIN SYSOBJECTS O ON 
	T.PARENT_ID = O.ID
WHERE 
	C.[text] LIKE '%' + @TRIGGER + '%'
	AND OBJECTPROPERTY(C.id, 'IsTrigger') = 1
	ORDER BY
	Nm_trigger

	