How To Use DESelect Segment
Troubleshooting
Error "Violation of PRIMARY KEY constraint. Cannot insert duplicate key"
after completing a selection, and even though you might have previewed it to validate your results, when you run, you might get the following error violation of primary key constraint cannot insert duplicate key this error can occur when you are using either append or update data action it happens when the records you are trying to store inside your target data extension contain the same primary key value more than once read the following table to understand, based on the data action you are using, what is the cause, and how you can solve it true 220,220,221left unhandled content type left unhandled content type left unhandled content type left 3 unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left 3 unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type how to test this? if you try to run preview or you use the overwrite data action, it will work because sfmc automatically removes the duplicates of primary key and keeps only one of them in order to test this, you can follow these steps 1\ duplicate the selection you are working on then start working on the copied selection 2\ create an in filter and include only the primary keys indicated on the error message 3\ create an identical target data extension without any primary key 4\ use the sort & limit feature to order by the primary key field 5\ now you can run preview on the selection and have a view on the duplicates note while running preview, deselect segment stores the results in an empty temporary data extension, instead of the actual target data extension you selected this is the reason why in some cases you can only see this error when running your selection, but not when you are previewing it