I have a table with the following structure
Id | Data |
---|---|
1 | 5#SkipData#Data1,Data2,Data3 |
2 | 5#SkipData#Data4 |
3 | 5#SkipData#Data5,Data6,Data7,Data8,Data9 |
I want to put the data in another table with the following format:
Id | SeperatedData |
---|---|
1 | Data1 |
1 | Data2 |
1 | Data3 |
2 | Data4 |
3 | Data5 |
3 | Data6 |
3 | Data7 |
3 | Data8 |
3 | Data9 |
The skipdata has length of 5 whereas all data have fixed length 13. The data's are seperated by comma (,) symbol as mentioned in the table. Currently, this is implemented in the stored procedure using cross apply and performance is quite poor.
The following data transformation is done in sql stored procedure.