SQL Server拆分改变地址长度到特定列

时间:2017-09-07 16:20:09

标签: sql-server string split varying

我正在尝试将变化的字符串地址拆分为特定的地址格式列。我尝试过使用REPLACE,PARSENAME,SUBSTRING,LEFT,RIGHT,但它并没有让我到任何地方。这是地址字段的格式,你可以看到我想要放入4列到8的任何内容

Address, line 1
Address, line 2
Address, line 3
Address, line 4
Address, line 5
City
County
PostCode
Country

示例数据:

LASHAM AIRFIELD,LASHAM,GU34 5SP,Alton,Hampshire,United Kingdom
Pinners Hall,105-108 Old Broad Street,EC2N 1ER,London,United Kingdom
Allenby Laboratories,Wigan Road,Westhoughton,BL5 2AL,Bolton,Lancashire,United Kingdom
Old Church House,Sandy Lane,Crawley Down,RH10 4HS,Crawley,West Sussex,United Kingdom
Woodgate Business Park,1 Bell Heath Way,B32 3BZ,Birmingham,West Midlands,United Kingdom
5 Tillingbourne Court,The Dorking Business Park,Station Road,RH4 1HJ,Dorking,Surrey,United Kingdom
93 Fleet Road,GU51 3PJ,Fleet,Hampshire,United Kingdom

0 个答案:

没有答案