I today ran into a really weird problem in SQL Server (both 2008R2 and 2012). I\'m trying to build up a string using concatenation in combination with a select
Seems a bit like this post: VARCHAR(MAX) acting weird when concatenating string
The conclusion there: This approach to string concatenation does usually work but it isn't guaranteed. The official line in the KB article for a similar issue is that "The correct behavior for an aggregate concatenation query is undefined."