Skip to content

Instantly share code, notes, and snippets.

Created January 26, 2021 23:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
SFMC all subscribers in all business units
, s.SubscriberKey
, s.Status
, s.EmailAddress
, s.DateUnsubscribed
, s.DateJoined
, s.DateUndeliverable
, b.businessUnitMID
, b.businessUnitName
from _subscribers s
outer apply (
select 1 businessUnitMID, 'Business Unit Name 1' businessUnitName union all
select 2 businessUnitMID, 'Business Unit Name 2' businessUnitName union all
select 3 businessUnitMID, 'Business Unit Name 3' businessUnitName union all
select 4 businessUnitMID, 'Business Unit Name 4' businessUnitName union all
select 5 businessUnitMID, 'Business Unit Name 5' businessUnitName
) b
/* name: subscribers_all */
/* target: subscribers_all */
/* action: overwrite */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment