All Forums Database
SREDDY11 6 posts Joined 05/15
08 May 2016
Help with update statement

UPDATE

   ENTPR_INTEL_TDW.VBC_MBR_ATTRBTN_RSLT

FROM 

ENTPR_INTEL_TDW.VBC_MBR_ATTRBTN_RSLT MBR      

LEFT JOIN

entpr_vbcm_r3.vbc_prov_pgm_xwalk a      

ON MBR.ATTRBTN_PROV_PGM_FILLR_NM = a.vbc_prov_pgm_nm

SET

   MBR.ATTRBTN_PROV_PGM_NM = a.vbc_prov_pgm_id  

WHERE

   MBR.MBR_ATTRBTN_RSLT_ID = 38087853

yuvaevergreen 93 posts Joined 07/09
08 May 2016

Whats the issue? I suspect the syntax may not be correct.

Fred 1096 posts Joined 08/04
09 May 2016

Syntactically: when the FROM clause includes the target table, use the alias before the FROM. Never use the alias on left hand side of SET.
 
UPDATE MBR
FROM ENTPR_INTEL_TDW.VBC_MBR_ATTRBTN_RSLT MBR
LEFT JOIN ENTPR_VBCM_R3.VBC_PROV_PGM_XWALK A
ON MBR.ATTRBTN_PROV_PGM_FILLR_NM = A.VBC_PROV_PGM_NM
SET ATTRBTN_PROV_PGM_NM = A.VBC_PROV_PGM_ID
WHERE MBR.MBR_ATTRBTN_RSLT_ID = 38087853;

You must sign in to leave a comment.