Refer below query.
For SplitString function refer below article.
SQL
declare @value as nvarchar(500), @latitude nvarchar(150), @longtude nvarchar (150)
set @value = '18.489861,73.855066#18.4898497,73.855016#18.4898475,73.8549116#18.490068320047676,73.85491859167814'
SELECT Item
INTO #Temp
FROM dbo.SplitString(@value, '#')
;WITH CTE AS
(
SELECT SUBSTRING(Item,0,CHARINDEX(',',Item)) 'Latitude',SUBSTRING(Item,CHARINDEX(',',Item)+1,LEN(Item)) 'Longitude' FROM #Temp
)
--SELECT * FROM CTE
Select
SUBSTRING(
(
SELECT ',' + Latitude
FROM CTE FOR XML PATH('')
), 2 , 9999) As Latitude,
SUBSTRING(
(
SELECT ',' + Longitude
FROM CTE FOR XML PATH('')
), 2 , 9999) As Longitude
DROP TABLE #Temp
Output
Latitude |
Longitude |
18.489861,18.4898497,18.4898475,18.490068320047676 |
73.855066,73.855016,73.8549116,73.85491859167814 |