In T-SQL, I need to separate a TEXT value by new lines character and then loop on each line.
In other words, I need an explode() function, but for T-SQL, and I need to to loop on each line.
I tough about creating a new temporary table and storing lines of the string in this table as rows, and then loop on this with a cursor. I’m just not sure about how to separate a string.
Is there a quick way to do this in T-SQL ?
(I supposed your data would be larger than 4000 caracters.)
The split function:
And the explode function: