OPENJSON()
OPENJSON() is a SQL function in the SQL Server Specific category. SQL Server 2016+: parses JSON text into rows and columns. Supports explicit schema with WITH clause. The syntax is SELECT * FROM OPENJSON(@json_string);. It accepts @json_string. It returns tabular JSON result. A typical example: DECLARE @json NVARCHAR(MAX) = N'[ {"id": 1, "name": "Alice", "salary": 75000}, {"id": 2, "name": "Bob", "salary": 65000} ]'; SELECT * FROM OPENJSON(@json) WITH ( id INT '$.id', name NVARCHAR(100) '$.name', salary DECIMAL '$.salary' ); -- Parses JSON array into relational rows A close relative is OUTPUT Clause, which sQL Server: returns values from DML statements (like PostgreSQL RETURNING). A close relative is STUFF(), which sQL Server: deletes a specified length of characters from a string and inserts another string at the start position. A close relative is FOR XML PATH, which sQL Server: converts query results to XML format. Commonly used for string concatenation hack.