delete from <PREFIXE_DW>INCIDENTS_FOURNISSEURS
<SEPARATEUR>
insert into <PREFIXE_DW>INCIDENTS_FOURNISSEURS (INF_CODE_FOURNISSEUR,INF_NIVEAU,INF_CODE,INF_DESCRIPTION,INF_NUM_CDE,INF_NUM_LIG_CDE,INF_NUM_BR,INF_NUM_LIG_BR,INF_CODE_ARTICLE,INF_DESIGNATION_ARTICLE,INF_QTE_REF_RET,INF_DATE,INF_DATE_CREAT_CDE,INF_DATE_LIV,INF_NUM_FAC,INF_FERME
)  
select distinct FOU,NIVEAU,CODE,DESCRIPT,NO_CDE,PO_CDE,NO_BR,PO_BR,ART,DES_ART,QTE_REFU,
CASE WHEN (DTE_OCCUR = ' ' OR DTE_OCCUR = '00000000' ) THEN NULL WHEN (DTE_OCCUR < '17530101') THEN CONVERT(datetime,'19000101' ,103) ELSE CONVERT(datetime,DTE_OCCUR ,103) END,
CASE WHEN (DTE_CREAT = ' ' OR DTE_OCCUR = '00000000' ) THEN NULL WHEN (DTE_CREAT < '17530101') THEN CONVERT(datetime,'19000101' ,103) ELSE CONVERT(datetime,DTE_CREAT ,103) END,
CASE WHEN (DTE_LIV   = ' ' OR DTE_OCCUR = '00000000' ) THEN NULL WHEN (DTE_LIV   < '17530101') THEN CONVERT(datetime,'19000101' ,103) ELSE CONVERT(datetime,DTE_LIV ,103) END ,
NO_FACT,
case when INC_FERME =0x54 then 1 else 0 end
from <PREFIXE_HA>FOURNINC
