IF EXISTS (SELECT name FROM sysobjects
      WHERE name = 'MAJ_BR_FROM_FAC' AND type = 'TR')
   DROP TRIGGER MAJ_BR_FROM_FAC
GO
CREATE TRIGGER MAJ_BR_FROM_FAC
    ON DOCUMENTS 
    AFTER UPDATE,INSERT,DELETE 
AS 

UPDATE BR
   SET    DOC_NUMERO_FAC = F.DOC_NUMERO_FAC,
	  DOC_NUMERO_LIGNE_FAC = F.DOC_NUMERO_LIGNE_FAC,
	  DOC_QUANTITE_LIGNE_FAC = F.DOC_QUANTITE_LIGNE_FAC,
	  DOC_MONTANT_LIGNE_FAC = F.DOC_MONTANT_LIGNE_FAC,
    DOC_DATE_FACTURE_FOURNISSEUR = F.DOC_DATE_FACTURE_FOURNISSEUR
    
FROM   BR B 
   INNER JOIN INSERTED F 
   ON B.DOC_NUMERO_BR = F.DOC_NUMERO_BR 
   and 	B.DOC_NUMERO_LIGNE_BR=F.DOC_NUMERO_LIGNE_BR

