Avatar of knamc
knamc
Flag for United States of America

asked on 

"|" Delimited column to rows

I have a column in a table that has multiple values seperated by "|".  I want to create rows for each value.
Each entry in the coumn can have 1 or 100 and I need to have each as a seperate row.

Here is an example of the data:

serverid                   IpAddresses
101                          172.25.230.119
102                          10.42.64.235|10.42.64.73|10.42.64.239|10.42.64.238
103                          10.99.90.21|10.99.90.103|10.99.90.102

I need the data to return as:

101                         172.25.230.119
102                         10.42.64.235
102                         10.42.64.73
102                         10.42.64.239
102                         10.42.64.238
103                         10.99.90.21
103                         10.99.90.103
103                         10.99.90.102


 
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
knamc

8/22/2022 - Mon