I'm going round in circles here :-(
I'm updating the Name field in my database. And I want to keep a backup incase something goes wrong (the format needs to be changed)
So I have table: TempData with fields 'FirstName', 'LastName', 'Email' and 'Tmp' as my backup
and table: Recipients with Fields 'FirstName', 'LastName', 'Email' and 'RID' as my actual data.
If I need to copy from TempData to Recipients -whats a good way?
Email is unqiue and won't be changed.
select TempData.*, Recipients.RecipientID as RID
into #TEMP1 from Recipients
left join TempData on Recipients.email = TempData.email
where Recipients.email <>"" and Recipients.email is not Null
UPDATE Recipients
Set FirstName = #TEMP1.FirstName
from #TEMP1, Recipients
where #TEMP1.Email = REcipients.Email
leaves me with lots of Null records... and I'm just lost.. and I've had too much coffee :-(
Any pointers appreciated!!
I'm updating the Name field in my database. And I want to keep a backup incase something goes wrong (the format needs to be changed)
So I have table: TempData with fields 'FirstName', 'LastName', 'Email' and 'Tmp' as my backup
and table: Recipients with Fields 'FirstName', 'LastName', 'Email' and 'RID' as my actual data.
If I need to copy from TempData to Recipients -whats a good way?
Email is unqiue and won't be changed.
select TempData.*, Recipients.RecipientID as RID
into #TEMP1 from Recipients
left join TempData on Recipients.email = TempData.email
where Recipients.email <>"" and Recipients.email is not Null
UPDATE Recipients
Set FirstName = #TEMP1.FirstName
from #TEMP1, Recipients
where #TEMP1.Email = REcipients.Email
leaves me with lots of Null records... and I'm just lost.. and I've had too much coffee :-(
Any pointers appreciated!!