1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
declare @JSON varchar(max); set @JSON = ' [ { "ConfigurationParameterID":1, "ParameterCode":"Beehive", "ParameterDescription":"Global parameter", "ParameterDataType":"D", "DefaultValueChar":null, "DefaultValueNumeric":null, "DefaultValueDate":null, "DefaultValueBit":null, "CreationDate":"2021-07-14T00:00:00", "CreatedBy":"K. Elst", "LastUpdateDate":"2021-07-14T00:00:00", "LastUpdatedBy":"K. Elst" }, { "ConfigurationParameterID":2, "ParameterCode":"Ape", "ParameterDescription":"It''s a bee", "ParameterDataType":"C", "DefaultValueChar":null, "DefaultValueNumeric":null, "DefaultValueDate":null, "DefaultValueBit":null, "CreationDate":"2021-07-15T00:00:00", "CreatedBy":"K. Elst", "LastUpdateDate":"2021-07-15T00:00:00", "LastUpdatedBy":"K. Elst" } ]'; select PRM.ConfigurationParameterID, PRM.ParameterCode, PRM.ParameterDescription, PRM.ParameterDataType, PRM.DefaultValueChar, PRM.DefaultValueNumeric, PRM.DefaultValueDate, PRM.DefaultValueBit, PRM.CreationDate, PRM.CreatedBy, PRM.LastUpdateDate, PRM.LastUpdatedBy from openjson(@JSON) with ( ConfigurationParameterID int, ParameterCode nvarchar(50), ParameterDescription nvarchar(255), ParameterDataType nchar(1), DefaultValueChar nvarchar(max), DefaultValueNumeric float, DefaultValueDate datetime, DefaultValueBit bit, CreationDate datetime, CreatedBy nvarchar(255), LastUpdateDate datetime, LastUpdatedBy nvarchar(255) ) as PRM |