SQLTeam.com | Weblogs | Forums

OpenJSON into Table

I have been successful in dumping JSON data into a table:

SELECT * FROM OPENJSON(@ResponseText, '$.Data') WITH
(
	  Field1							VARCHAR(50)		'$.Field100'
	, Field2							VARCHAR(50)		'$.Field200'
)

Question is there a way to dump it into a table without defining fields?

Thanks

In raw format, as nvarchar(max).

This is the closest that I have gotten and maybe I will pivot from here:

SELECT DISTINCT aT2.[key] FROM OPENJSON(@ResponseText, '$.Data') aT1
CROSS APPLY OPENJSON(aT1.value) aT2