title: FOR XML PATH and string concatenation
body: <p>I am trying to create a value that concatenates both hard coded strings and strings created using <code>FOR XML PATH</code>.</p>
  <pre><code>SUBSTRING(
  (SELECT (', ' + [value]) 
   FROM [values]
   FOR XML PATH( '' )
  ), 3, 1000) +
  ' text in between my values ' +
  SUBSTRING(
  (SELECT (', ' + [otherValue]) 
   FROM [otherValues]
   FOR XML PATH( '' )
  ), 3, 1000)
  </code></pre>
  <p>So I would expect something like: <code>Value1, Value2, Value3 text in between my values OtherValue1, OtherValue2, OtherValue3</code>, but instead I get a blank string.</p>
  <p>If I take out the substrings (including the query inside it) I get the values in between fine, and if I only add one of the substring blocks by itself I get the the list string back. So I can't work out why having concatenation with the substring and <code>FOR XML PATH</code> queries causes it return an empty string.</p>