How to split a string into variables in sql?

Viewed 46420

I have a string which looks like BAT | CAT | RAT | MAT I want to split this string into 4 parts and then store them into 4 different variables say .. @a,@b,@c,@d respectively.

How can it be done in sql?

3 Answers
Related