Consuming JSON Strings in SQL Server

This article describes a TSQL JSON parser and its evil twin, a JSON outputter, and provides the source. It is also designed to illustrate a number of string manipulation techniques in TSQL. With it you can do things like this to extract the data from a JSON document: 

 Select * from parseJSON('{



     "firstName": "John",

     "lastName": "Smith",

     "age": 25,



        "streetAddress":"21 2nd Street",

        "city":"New York",






        "home":"212 555-1234",

        "fax":"646 555-4567"