Transpose a word written vertically to horizontally in SQL Server
up vote
3
down vote
favorite
I want to use T-SQL to transpose a column with a word, such as t r a i n into train I tried using pivot, but instead of getting only one row back with the transposed column, I got a 5x5 table showing 'train' along the diagonal, and NULL everywhere else. This result makes sense to me, but it's not what I want. I just want to transpose a word written vertically into the same word but written horizontally. How should I approach this with pivot? Or is there an easier way to do it otherwise? Conversely, if I had instead started out with a word train how would I transpose this word to make it print vertically? t r a i n Thank you!
sql sql-server tsql transpose
sh...