Click to See Complete Forum and Search --> : Create multiple rows from one column ?


Dilip Patel
03-14-2000, 01:42 PM
Is there a way to create multiple rows from one column which containg a list
?


Example : Col1 Col2 Col3
Serv1;Serv2;Serv4 140 minutes NT

Split into this
Col1 Col2
Col3
Serv1 140 minutes NT
Serv2 140 minutes NT
Serv4 140 minutes NT

Vadim Levinzon
03-14-2000, 05:53 PM
to do this in T-SQL you need two while loops (nested) and
patindex,substring functions
You can loop(outer) through every row in source table storing values in
variables
and then in the inner loop break your col1 into values and do insert