/*Ajout champs*/
if not exists (select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='DOCUMENTS' and COLUMN_NAME='DOC_RAISON_SOCIALE') alter table DOCUMENTS add DOC_RAISON_SOCIALE VARCHAR(255) default ' ' not null
<SEPARATEUR>
update doc SET doc.DOC_RAISON_SOCIALE = FRS_RAISON_SOCIALE FROM DOCUMENTS doc JOIN FOURNISSEURS frs ON doc.DOC_CODE_FOURNISSEUR = frs.FRS_CODE_FOURNISSEUR
<SEPARATEUR>
if not exists (select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='DOCUMENTS' and COLUMN_NAME='DOC_NOM_ACHETEUR') alter table DOCUMENTS add DOC_NOM_ACHETEUR VARCHAR(255) default ' ' not null
<SEPARATEUR>
update doc SET doc.DOC_NOM_ACHETEUR = USR_NOM_UTILISATEUR FROM DOCUMENTS doc JOIN UTILISATEURS u ON doc.DOC_CODE_ACHETEUR = u.USR_CODE_UTILISATEUR
<SEPARATEUR>
if not exists (select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='DOCUMENTS' and COLUMN_NAME='DOC_DESIGNATION_SECTION_IMPUTATION') alter table DOCUMENTS add DOC_DESIGNATION_SECTION_IMPUTATION VARCHAR(255) default ' ' not null
<SEPARATEUR>
update doc SET doc.DOC_DESIGNATION_SECTION_IMPUTATION = SI_DESIGNATION FROM DOCUMENTS doc JOIN SECTIONS_IMPUTATIONS s ON doc.DOC_CODE_SECTION_IMPUTATION = s.SI_CODE_SECTION_IMPUTATION and DOC_CODE_SOCIETE=SI_CODE_SOCIETE
