If I have data in the following format
id subid text 1 1 Hello 1 2 World 1 3 ! 2 1 B 2 2 B 2 3 Q
And would like it in this format:
id fold 1 HelloWorld! 2 BBQ
How could I accomplish it in T-SQL?
I would strongly suggest against that. That is the sort of thing that should be handled in your application layer.
But… if you must:
Concatenating Row Values in Transact-SQL