Skip to content

Commit 5763c32

Browse files
authored
capitalized the keywords
1 parent fb082fc commit 5763c32

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

docs/t-sql/functions/openjson-transact-sql.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Is a Unicode character expression containing JSON text.
6969
OPENJSON iterates over the elements of the array or the properties of the object in the JSON expression and returns one row for each element or property. The following example returns each property of the object provided as *jsonExpression*:
7070

7171
```sql
72-
DECLARE @json NVarChar(2048) = N'{
72+
DECLARE @json NVARCHAR(2048) = N'{
7373
"String_value": "John",
7474
"DoublePrecisionFloatingPoint_value": 45,
7575
"DoublePrecisionFloatingPoint_value": 2.3456,
@@ -199,11 +199,11 @@ DECLARE @json NVARCHAR(MAX) = N'[
199199
SELECT *
200200
FROM OPENJSON ( @json )
201201
WITH (
202-
Number varchar(200) '$.Order.Number',
203-
Date datetime '$.Order.Date',
204-
Customer varchar(200) '$.AccountNumber',
205-
Quantity int '$.Item.Quantity',
206-
[Order] nvarchar(MAX) AS JSON
202+
Number VARCHAR(200) '$.Order.Number',
203+
Date DATETIME '$.Order.Date',
204+
Customer VARCHAR(200) '$.AccountNumber',
205+
Quantity INT '$.Item.Quantity',
206+
[Order] NVARCHAR(MAX) AS JSON
207207
)
208208
```
209209

@@ -321,7 +321,7 @@ The same query can be rewritten by using `OPENJSON` with an explicitly defined s
321321
```sql
322322
SELECT SalesOrderID, OrderDate, value AS Reason
323323
FROM Sales.SalesOrderHeader
324-
CROSS APPLY OPENJSON (SalesReasons) WITH (value nvarchar(100) '$')
324+
CROSS APPLY OPENJSON (SalesReasons) WITH (value NVARCHAR(100) '$')
325325
```
326326

327327
In this example, the `$` path references each element in the array. If you want to explicitly cast the returned value, you can use this type of query.
@@ -334,7 +334,7 @@ The following query combines relational rows and JSON elements into the results
334334
SELECT store.title, location.street, location.lat, location.long
335335
FROM store
336336
CROSS APPLY OPENJSON(store.jsonCol, 'lax $.location')
337-
WITH (street varchar(500) , postcode varchar(500) '$.postcode' ,
337+
WITH (street VARCHAR(500) , postcode VARCHAR(500) '$.postcode' ,
338338
lon int '$.geo.longitude', lat int '$.geo.latitude')
339339
AS location
340340
```
@@ -364,10 +364,10 @@ DECLARE @json NVARCHAR(max) = N'{
364364
INSERT INTO Person
365365
SELECT *
366366
FROM OPENJSON(@json)
367-
WITH (id int,
368-
firstName nvarchar(50), lastName nvarchar(50),
369-
isAlive bit, age int,
370-
dateOfBirth datetime2, spouse nvarchar(50))
367+
WITH (id INT,
368+
firstName NVARCHAR(50), lastName NVARCHAR(50),
369+
isAlive BIT, age INT,
370+
dateOfBirth DATETIME, spouse NVARCHAR(50))
371371
```
372372

373373
### Example 6 - Simple example with JSON content

0 commit comments

Comments
 (0)