Get Correctly Formatted Deep-Nested JSON Files At Scale Directly From (Azure) SQL Server

Luca Zavarella
Microsoft Azure

--

Some third party applications usually ask for JSON files as input to import new data. An example is Splunk, a software platform to search, analyze and visualize the machine-generated data gathered from the websites, applications, sensors, devices etc. If the JSON format is mandatory for sharing information and the data you need to analyze is stored in a database, you need to transform your data from a tabular format to a JSON one, following a JSON schema. If you give this task to developers, the first idea they usually follow is to develop an application (in C#, Java or whatever programming language) that connects to the source database, loads data using an ORM (with consequent possible performance issues due to the inability to write optimum SQL code), transforms them using proper libraries and then exports the output in a JSON file. But if your data is stored in a Microsoft SQL Server Database, you are lucky, since starting from the 2016 version for the on-premises version and on Azure SQL Database, you can manage JSON data directly into your RDBMS.

Sample Database

The database we’ll use for our examples is the WideWorldImporters Sample one. For an overview of its content, check the corresponding documentation.

--

--

Luca Zavarella
Microsoft Azure

Microsoft MVP for AI and Data Platform, Head of Data & AI at iCubed. Classical pianist in the free time.