Skip to content

Commit f346561

Browse files
authored
Merge pull request #4090 from douglaslMS/json-example-fix
Pointed out that Example 1 can't be run as is.
2 parents 6fb6371 + 51b5913 commit f346561

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/t-sql/functions/json-value-transact-sql.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,13 @@ SET @jsonInfo=N'{
103103
## Examples
104104

105105
### Example 1
106-
The following example uses the values of the JSON properties `town` and `state` in query results. Since **JSON_VALUE** preserves the collation of the source, the sort order of the results depends on the collation of the `jsonInfo` column.
106+
The following example uses the values of the JSON properties `town` and `state` in query results. Since **JSON_VALUE** preserves the collation of the source, the sort order of the results depends on the collation of the `jsonInfo` column.
107+
108+
> [!NOTE]
109+
> (This example assumes that a table named `Person.Person` contains a `jsonInfo` column of JSON text, and that this column has the structure shown previously in the discussion of lax mode and strict mode. In the AdventureWorks sample database, the `Person` table does not in fact contain a `jsonInfo` column.)
107110
108111
```sql
109-
SELECT FirstName,LastName,
112+
SELECT FirstName, LastName,
110113
JSON_VALUE(jsonInfo,'$.info.address[0].town') AS Town
111114
FROM Person.Person
112115
WHERE JSON_VALUE(jsonInfo,'$.info.address[0].state') LIKE 'US%'

0 commit comments

Comments
 (0)