I have 2 tables, payee and drs_payee. I'm trying to update the email in payee but add to the email address which is already in that field. I want to just update this email and set the field email_summary = 'Y' when the field factoring_company_id = 'OTRCCHIL' from the drs_payee table. Problem is I have an email field in payee and an email field in drs_payee both named 'email'. I have written the following script but it is not liking something with this...If someone could assist I would appreciate it
update payee
set email = p.email
from payee p
Inner Join drs_payee as d
on p.id = d.id and d.factoring_company_id = 'OTRCCHIL'
set p.email = p.email + ',user@domain.com' ,email_summary = 'Y' from payee p
update payee
set email = p.email
from payee p
Inner Join drs_payee as d
on p.id = d.id and d.factoring_company_id = 'OTRCCHIL'
set p.email = p.email + ',user@domain.com' ,email_summary = 'Y' from payee p