The nvarchar(max) data type lets you store JSON documents that are up to 2 GB in size. This structure is a good choice for the classic NoSQL scenarios where you want to retrieve a document by ID or update a stored document by ID. The primary key _id is an auto-incrementing value that provides a unique identifier for every document and enables fast lookups. This structure is equivalent to the collections that you can find in classic document databases. The simplest way to store JSON documents in SQL Server or SQL Database is to create a two-column table that contains the ID of the document and the content of the document. This approach increases the load time because JSON parsing is done during load however, queries are matching performance of classic queries on the relational data. Fragments from the input JSON documents can be stored in the SQL data type columns or in NVARCHAR columns containing JSON sub-elements. Relational storage - JSON documents can be parsed while they are inserted in the table using OPENJSON, JSON_VALUE or JSON_QUERY functions.This approach might introduce additional performance penalty on query/analysis time if indexing on JSON values in not performed, because the raw JSON documents must be parsed while the queries are running. This is the best way for quick data load and ingestion because the loading speed is matching loading of string columns. LOB storage - JSON documents can be stored as-is in NVARCHAR columns.
SQL MINIFY HOW TO
The first storage design decision is how to store JSON documents in the tables. This article describes the options for storing JSON documents in SQL Server or SQL Database. You can store JSON documents in SQL Server or SQL Database and query JSON data as in a NoSQL database. SQL Server and Azure SQL Database have native JSON functions that enable you to parse JSON documents using standard SQL language.