I am trying to take my information from a Data Extension which contains new customer emails and put them in another Data Extension which severs as our companies master list.

I am able to populate the Temp Id on the New_Customer_Signup however when I try to update the RMWL_Master_Email_List (the activity that this query that drops the data into I get this error message, "Query failed during execution.

Error: Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object 'RMWL Master Email List'. The duplicate key value is (Temp Id)

I checked to make sure that the Temp Id didn't already exist in our Master List and it does not. Any ideas?

select 
'Temp ID' as 'Subscriber Key',
'Email Address' as 'Email',
'First Name' as 'First Name',
'Last Name' as 'Last Name',
'Date Added' as 'Date Added'
from New_Customer_Signup
up vote 4 down vote accepted

Your syntax is inserting literal strings into each column.

Also no need to alias columns if you're not changing the name.

Give this a try:

select 
  [Temp ID] as 'Subscriber Key'
, [Email Address] as 'Email'
, [First Name]
. [Last Name]
, [Date Added]
from New_Customer_Signup
  • Thank you so much Adam this worked perfectly. I appreciate your time! – Cameron Dec 10 at 21:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.