sql server import json
SELECT *
FROM OPENJSON(@json)
WITH (id int 'strict $.id',
firstName nvarchar(50) 'strict $.info.name',
lastName nvarchar(50) '$.info.surname',
age int,
dateOfBirth datetime2)SELECT *
FROM OPENJSON (@JSON, '$.data.assets.parcels')
WITH (id VARCHAR(7),
x INT,
y INT,
price INT '$.auction_price') -- new column name
)
SELECT ISJSON(@JSON)
If (ISJSON(@JSON)=1)
SELECT @JSON AS 'JSON Text'
DECLARE @JSON VARCHAR(MAX)
SELECT @JSON = BulkColumn
FROM OPENROWSET
(BULK 'C:\file-location\my-data.json', SINGLE_CLOB)
AS j
{
"ok": true,
"data": {
"assets": {
"parcels": [{
"id": "51,100",
"x": 51,
"y": 100,
"auction_price": 4444,
"district_id": "77909d00",
"owner": "Dr Cornwallis",
"data": { "version": 0 }
},
//...+ 2499 more objects in the parcels array
],
total: 2500
},
},
}
Also in JavaScript:
- load js
- jquery multiple div click
- CChartpie react
- javascript sleep settimeout
- Module Error (from ./node_modules/eslint-loader/dist/cjs.js):
- js regex password
- js alert
- indexing string in javascript
- how to add js in flask
- getusermedia example
- socket.io client send data node js server
- ojs link privacy page
- how to change css with js
- math js
- object destructuring into this
- disable mixed content via javascript
- react native button round
- Merging Or Copying Arrays Using Spread Operator
- how to compare javascript objects
- lodash merge
- javascript replace without replace()
- onclick open modal jquery
- how to code a check age function in javascript
- js array.pop