Question : split comma delimited values into seperate columns in SQL 2005


I have a Demographics table in SQL. Column 1 is an ID Field and Column 2 is an Address Field. The address field is Street,Street2,Street3,City,State, Zip. I need to seperate the address column so i have each address item as its own column.

Current
ID  ADDRESS
1   123 SW ANY ST,,,MIAMI,FL,33330

I need
ID  Street 1                       Street2 Street3 CITY    ST     ZIP
1   123 SW ANY STREET                          Miami   FL     33330

The table name is ADEMO
Column Names are ID and ADDRESS

I have tried to search on how to split it and run procedures however i have not had any luck. Please help

Answer : split comma delimited values into seperate columns in SQL 2005

missed a bracket there
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
select  ID, 
 [1] as Street1,
[2] as Street2,
[3] as Street3,
[4] as City,
[5] as ST,
[6] as ZIP
from (
select a.ID, b.Value, b.rn
from ADEMO a
cross apply dbo.Parmstolist(a.address, ',') b
) o
pivot (max(Value) for rn in ([1],[2],[3],[4],[5],[6])) p
Random Solutions  
 
programming4us programming4us