/*Documents rattachés pour 086*/
if  exists (select * from sysobjects where name='DOCUMENTS_ATTACHES' and xtype='U') drop table DOCUMENTS_ATTACHES
select NO_DA as DOCA_DOCUMENT,COD_ENR as DOCA_CODE ,TYPE_PJ as DOCA_TYPE_DOCUMENT, TITRE, NOM_ORI as DOCA_NOM_FICHIER
into DOCUMENTS_ATTACHES
from <PREFIXE_HA>DOC_ATT doc <WITHNOLOCK>