After completing a selection, and even though you might have previewed to validate your results when you run you might get the following error:
Violation of PRIMARY KEY constraint. Cannot insert duplicate key.
This error might happen when you are using the Append Data Action. It occurs if the primary key of one of the records you are trying to insert already exists inside your Target Data Extension.
This can be solved in two ways:
- Consider using data action Update instead.
- Use deduplication on the primary key field.
While running preview, DESelect stores the results in an empty temporary data extension, instead of the actual Target Data Extension you chose, this is the reason why you can't see this error in preview as well.