SQL Server JSON Data Type
SQL Server’s native json data type stores JSON documents in a binary format. It is distinct from the JSON functions introduced in SQL Server 2016, which can query JSON text stored in varchar or nvarchar. The native type is generally available in SQL Server 2025 (17.x), Azure SQL Database, Azure SQL Managed Instance with the SQL Server 2025 or Always-up-to-date update policy, and SQL database in Microsoft Fabric. Earlier SQL Server versions can still use the JSON functions with character columns, but do not have the native json system type. See Microsoft’s JSON data type reference and SQL Server 2025 release notes.
Define a json column
Use json in a table definition as you would another SQL Server data type:
CREATE TABLE dbo.Events (
EventId bigint IDENTITY PRIMARY KEY,
Payload json NOT NULL
);
INSERT INTO dbo.Events (Payload)
VALUES ('{"eventType":"order.created","orderId":1042}');
SELECT EventId,
JSON_VALUE(Payload, '$.eventType') AS event_type,
JSON_VALUE(Payload, '$.orderId') AS order_id
FROM dbo.Events;
The native type validates input and stores the document in a parsed binary representation. This can improve reads, updates, and storage for suitable workloads compared with storing the same document as text; measure with your data and queries before changing an established schema. Existing JSON functions can query the native type. In SQL Server 2025, OPENJSON also accepts json values.
Valid values and compatibility
The native type accepts a JSON object or array at the document root. A JSON scalar such as a top-level number, string, Boolean, or JSON null is not a valid document for this type. SQL NULL is a separate SQL value and can be stored in a nullable json column.
The native json type is available at all database compatibility levels. This does not change the compatibility requirements of JSON functions when they operate on character data; consult each function’s documentation when supporting older databases. Unlike varchar or nvarchar, json does not allow implicit conversions. Explicit CAST or CONVERT is limited to character types, and JSON columns cannot be used as key columns in an ordinary CREATE INDEX statement.
SQL Server 2025 also documents CREATE JSON INDEX, but Microsoft’s current statement reference labels that feature as preview. Treat that index as a separate feature from the generally available data type and check its status and production guidance for the exact SQL Server build before relying on it. For established workloads, see Microsoft’s guidance to index JSON properties.
When to use json or nvarchar
Use the native type when the column represents JSON documents, write-time validation is useful, and the target service supports the feature. Use nvarchar when you need compatibility with older SQL Server releases, a string-oriented integration, or exact preservation of the original text representation. The native type does not replace relational columns for values that are frequently constrained, joined, or aggregated; keep those values relational when that better fits the data model.
For the current function set and query patterns, see Microsoft’s JSON data in SQL Server. For implicit conversions in mixed-type expressions, see SQL Server data type precedence.