Overview Format Query Results as JSON with FOR JSON (SQL Server) Format Nested JSON Output with PATH Mode Format JSON Output Automatically with AUTO Mode Add a Root Node to JSON Output with the ROOT Option Include Null Values in JSON Output with the INCLUDE_NULL_VALUES Option Remove Square Brackets from JSON Output with the WITHOUT_ARRAY_WRAPPER Option (SQL Server) How FOR JSON converts SQL Server data types to JSON data types How FOR JSON escapes special characters and control characters Use FOR JSON output in SQL Server and in client apps Convert JSON Data to Rows and Columns with OPENJSON Use OPENJSON with the Default Schema Use OPENJSON with an Explicit Schema Validate, Query, and Change JSON Data with Built-in Functions JSON Path Expressions Import JSON documents into SQL Server Index JSON data Optimize JSON processing with in-memory OLTP Solve common issues with JSON in SQL Server