One of column (Say column1 in table Table1) stores data as follow
Column1 test2;test1;test3 test21;test11;test32 --
I want to update this column so that data is stored in sorted form(after splitting the data by 😉 as follow
Column1 test1;test2;test3 test11;test21;test32 --
How to write query in a simplest form? I am using SQL Server 2005
Can I assume there is not a simple solution available using T-SQL then I can go with CLR function?
An example of how to do this in T-SQL in a set-based fashion. It assumes that the target table has a PK which uniquely identifies each row.
Note that the sort is text-based. I have added a third line of test data to show this.