I have a DE (DataExtension) for members, and another for members' children, which are also members but linked to the parent in question. DataExtensions Example

I would like to be able to group up sends, so I don't overburden the parent with, for example 3 emails if they register their 3 kids at the same time. Both DE's are linked by the parent's Id, the column used later for the send logic.

One of the options I though of is achieving something like this: New DE to Obtain

I was thinking of using the STUFF function, but I don't see a way to make it work.

Any idea how to achieve this?

  • Please update your question to include samples of the source data and the desired output. The "group up sends" isn't specific enough. Dec 20, 2021 at 14:02

2 Answers 2


I actually wrote a blog post a while back about pretty much this exact thing. Reference here for a ton of more details on the whole process.

You were right to go with Stuff, but I think the part you were missing was the FOR XML PATH part.

Example of solution:

SELECT a.id,
emailStr = STUFF(
    SELECT ',' + b.email
    FROM [myDE] b
    WHERE a.id = b.id
    FOR XML PATH('')
  ), 1, 1, '')

In this case it takes the email field from myDE and makes it a delimited field that is grouped together by the id field.

  • Hello, thanks for answering! The issue I find with this solution is that I get an error saying Unable to create temporary data extension: Field name cannot contain the character =. Dec 20, 2021 at 14:51
  • If its Query Studio then know that tosses syntax errors on things valid in an Auto Studio Query Activity Dec 20, 2021 at 16:21

We are unable to completely understand your requirement! Based on a similar project, I have tried to illustrate your requirement. Hope this helps you to implement. [If NOT at least it might help some others trying to implement similar one!.

  • Hoping your NOT Triggering emails immediately after registration.

enter image description here

  • Hi there, thank you for answering, I will try this method and see if I can achieve what I was trying to :) Dec 20, 2021 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .