Skip to content
Advertisement

split data in a single row into multiple records

I need to split a comma separated field into multiple records based on ‘,’

enter image description here

Advertisement

Answer

Youll want to use string_split like this:

select t.S.No, x.Value
from yourTable t
CROSS APPLY  string_split(Char, ',') x
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement