Please consider the following statement:

```
select stuff((
           select '; ' + ([FIELD_1] + [FIELD_2] + [...] + [FIELD_N])
           from   [TABLE] t1
           where  t1.[ID] = t2.[ID]
           for    xml path ('')
        ),1,1, '')
from    [TABLE] t2

```

If the statement concatenates 10 records with the same `ID` but all records have no value ('', or empty, instead of `null`), the output is:

```
; ; ; ; ; ; ; ; ; ;

```

If 2 records are filled, I end up with

```
; ; ; AAA; ; ; ; BBB;

```

What I would want in these 2 cases is `null`, respectively `AAA; BBB`

I tried fixing it like this:

```
select stuff((
           select case when [FIELD_1] <> '' then '; ' + ([FIELD_1]) else '' end
           from   [TABLE] t1
           where  t1.[ID] = t2.[ID]
           for    xml path ('')
        ),1,1, '')
from    [TABLE] t2

```

This works, and is elegantly enough for me when I'm only selecting `FIELD_1`. But when I'm selecting many concatinated fields (`FIELD_1 + ... + FIELD_N`), this becomes quite ugly fast.

What am I doing wrong? Isn't `stuff()` supposed to take care of my problem as a function?