1

I'm copying a data view (_unsubscribe) to a standard data extension so I can view it and manipulate it for our preference center.

It a simple query but I'm getting a violation of primary key error. Unsure why this would be the case since the subscriberkey is the primary key and should be entirely unique. It's an update query.

SELECT *
FROM _unsubscribe
2

A subscriber can unsubscribe from any individual list, publication list, suppression list, and All Subscribers. So there are many scenarios where a single subscriber key would appear multiple times on the '_Unsubscribe' data view, which is why the data view doesn't have a primary key.

You could either not use a primary key and simply append on each run of the query, or you could create a compound primary key such as 'Subscriber Key + ListID + EventDate".

If you're looking to reference something for a preference center, you would probably be better off reference the '_Subscribers' or '_ListSubscribers' data views - '_Unsubscribe' is more for tracking individual unsubscribe events.

  • Layer on complication is this: we don’t use publication lists or other lists. – Tom Callahan Jun 21 '18 at 15:31
  • Could be from an unsubscribe --> resubscribe --> unsubscribe scenario perhaps? That would be recorded twice with different dates, potentially leading to the error. – AnonWonderer Jun 21 '18 at 15:34
  • Interesting. That could be it. I'll tool around with it. – Tom Callahan Jun 21 '18 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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