Using SQL Server 2022 this is simple using the new functions
use tempdb
GO
drop table if exists T
GO
create table T (
Numbers VARCHAR(MAX),
Addresses VARCHAR(MAX)
)
GO
INSERT T(Numbers,Addresses) values ('1^2^3^4','Home1^Home2^Office1^Office2')
GO
SELECT [address] = t2.[value], [Homenumber] = t1.[value]
FROM T
CROSS APPLY string_split(T.Numbers, '^', 1) t1
CROSS APPLY string_split(T.Addresses, '^', 1) t2
WHERE t1.ordinal = t2.ordinal
FOR JSON AUTO
GO
Above query returns: [{"address":"Home1","Homenumber":"1"},{"address":"Home2","Homenumber":"2"},{"address":"Office1","Homenumber":"3"},{"address":"Office2","Homenumber":"4"}]
Which if I format it to pretty JSON you get
[
{
"address": "Home1",
"Homenumber": "1"
},
{
"address": "Home2",
"Homenumber": "2"
},
{
"address": "Office1",
"Homenumber": "3"
},
{
"address": "Office2",
"Homenumber": "4"
}
]
I assume that the OP is using older version, so I will wait for the missing information we asked above in the comment :-)
Note! Before version 2022, we cannot count on the order that the function string_split returns! Therefore it is not a solution