I have a table in SQL Server that contains an ID and also a column with multiple values separated by a comma (like the example below)
ID Category_number
-------------------------
1 3,5,6,8
2 4,8,23
3 4,7,5,3
I need to make this into a lookup table with 1 category number per row, so like below;
ID Category_Number
-------------------------
1 3
1 5
1 6
I have been told that XPATH might be the solution to this. Does anyone have any sample code that will do this?
Thanks
See this answer Split
Create that function in your database.
Then you can create the results you want using: