IF  EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[T_UPDATE_RESOURCENAME_FROM_PERSON]'))
	DROP TRIGGER [dbo].[T_UPDATE_RESOURCENAME_FROM_PERSON]
IF  EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[T_PLANTA_COMPARISON_NAMES]'))
	DROP TRIGGER [dbo].[T_PLANTA_COMPARISON_NAMES]
GO
CREATE TRIGGER [dbo].[T_UPDATE_RESOURCENAME_FROM_PERSON]
ON [dbo].[DT516] AFTER UPDATE
AS 
-- avoid unnecessary traffic
SET  NOCOUNT  ON
BEGIN
	IF UPDATE(DI027357)
		UPDATE dbo.DT467 SET di001275 = inserted.DI027357
		FROM inserted LEFT JOIN deleted ON inserted.DI010420 = deleted.DI010420
		WHERE DT467.DI040609 = inserted.DI010420 AND 
			COALESCE(inserted.DI027357,'') != COALESCE(deleted.DI027357,'')
END
GO
