There is also a Transact-SQL-only solution that does not use .NET functionality at all. It is written by Phil Factor and described in two articles:
- Consuming JSON Strings in SQL Server: You can find this article at https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/.
- Producing JSON Documents from SQL Server queries via TSQL: The article is available at https://www.simple-talk.com/sql/t-sql-programming/producing-json-documents-from-sql-server-queries-via-tsql/.
Since it processes text with Transact-SQL only, the solution is not performant, but it can be used to process small or moderate JSON documents.