You can do json directly in SSIS, but you can also use SQL Server
Insert the Json in a table using ssis, and then parse it for example using Openjson:
Here I insert your example json in a temp table, and query it using tsql:
DECLARE @json NVARCHAR(MAX) =
N'
[{"@type":"Offer","availability":"https://schema.org/InStock","price":"479.00","priceCurrency":"EUR","url":"https://www.mantel.com/cube-aim-pro&spec[]=9470&spec[]=2756&spec[]=285"}
,{"@type":"Offer","availability":"http://schema.org/OutOfStock","price":"479.00","priceCurrency":"EUR","url":"https://www.mantel.com/cube-aim-pro&spec[]=9470&spec[]=2768&spec[]=285"}
,{"@type":"Offer","availability":"http://schema.org/OutOfStock","price":"479.00","priceCurrency":"EUR","url":"https://www.mantel.com/cube-aim-pro&spec[]=9470&spec[]=2811&spec[]=285"}
,{"@type":"Offer","availability":"http://schema.org/OutOfStock","price":"479.00","priceCurrency":"EUR","url":"https://www.mantel.com/cube-aim-pro&spec[]=9470&spec[]=2757&spec[]=285"}]
,"aggregateRating":{"@type":"AggregateRating","ratingValue":"9.0","ratingCount":"6","bestRating":"10"}}'
CREATE TABLE #tmp (
id INT IDENTITY (1, 1) NOT NULL
, json NVARCHAR(MAX) NOT NULL
)
INSERT INTO #tmp (json)
VALUES (@json)
SELECT [AdType]
, [availability]
, [price]
, [priceCurrency]
, [url]
FROM (
SELECT TOP 1 json
FROM #tmp
ORDER BY id DESC
) a
OUTER APPLY OPENJSON(a.json)
WITH
(
AdType VARCHAR(100) '$."@type"'
, availability NVARCHAR(256)
, price DECIMAL(19, 2)
, priceCurrency NVARCHAR(3)
, url NVARCHAR(512)
)
You have python in your tags. If you are using Python to fetch the data you can just parse the json into a python object directly without using SSIS or SQL server however
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…