Blog Post

SQL Server Blog
1 MIN READ

Announcing the Public Preview of JSON index in SQL Server 2025

uc-msft's avatar
uc-msft
Icon for Microsoft rankMicrosoft
May 19, 2025

We are excited to announce the Public Preview of the JSON index for JSON data type in SQL Server 2025. The new JSON index allows you to index JSON scalars, objects and aggregates in a JSON document and optimize queries on the JSON document.

JSON Index

The new JSON index can be created on columns of JSON data type in a table. It is a single index that is used to optimize JSON functions like JSON_VALUE, JSON_PATH_EXISTS and JSON_CONTAINS. The new JSON index leverages the native JSON data type to extract the SQL/JSON paths and values from a JSON document. The JSON index can be created either on all the SQL/JSON paths in a JSON document or specify a set of SQL/JSON paths.

Next Steps

Try the new JSON index and native JSON data type today in SQL Server 2025. Submit your feedback, issues and scenarios in the user voice feedback forum or here. We are eager to learn how the JSON index helps improve your JSON query processing. You can find more details about the new JSON index below:

CREATE JSON INDEX (Transact-SQL) - SQL Server | Microsoft Learn

Published May 19, 2025
Version 1.0

1 Comment

  • HcD's avatar
    HcD
    Copper Contributor

    This sounds awesome ...but, will it support indexing/querying in json arrays ?

    Because a use case could be replacing a child table with a json field. Imagine an Order table that has an OrderLines childtable (with columns OrderId/ProductId/Amount/Price), linking the Order table to the Product table .

    One could eliminate the OrderLines table, and replace it with an OrderLinesJson as a json field in the Order table. But that means such a json would an array with multiple OrderLines containing ProductId and Price/Amount :

    [ {"ProductId" : 1,  "Price" : 5.0, "Amount" : 2},

    {"ProductId" : 2,  "Price" : 10.0, "Amount" : 1},

    {"ProductId" : 5,  "Price" : 11.5, "Amount" : 4},

    ..... ]

    Now imagine then you want to query for all Orders that have an OrderLine for ProductId X with a Amount bigger then Y

     

    This use case of replacing child tables is actually on the MS website but i find no info on how to query/index that  : https://learn.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server?view=sql-server-ver17

    Use cases for JSON data in SQL Server

    JSON support in SQL Server and Azure SQL Database lets you combine relational and NoSQL concepts. You can easily transform relational to semi-structured data and vice-versa. JSON isn't a replacement for existing relational models, however. Here are some specific use cases that benefit from the JSON support in SQL Server and in SQL Database.

    Simplify complex data models

    Consider denormalizing your data model with JSON fields in place of multiple child tables.