JSON (Java Script Object Notation) is a lightweight data interchange format.It is language independent, easy to understand and self-describing. JSON is a very popular data interchange format nowadays.In the following example, I have added Middle Name as a new attribute at Employee Info root.
The main benefit of connecting to external data is that you can periodically analyze this data without repeatedly copying the data to your workbook, which is an operation that can be time consuming and prone to error.
After connecting to external data, you can also automatically refresh (or update) your Excel workbooks from the original data source whenever the data source is updated with new information.
In the following example, I have modified two elements: “First Name” and “Last Name” .
Function FOR JSON is very useful when we need to export SQL table data as JSON format. Here, column names or aliases are used as key names for JSON object.
It is used to extract an array of data or object from the JSON string.
In the following example, I have extracted "Addresses" data from JSON object and first element of "Addresses" data from JSON object.
This function returns updated JSON string in NVARCHAR type.
This function is inserting the value in JSON string if the attribute in the provided path does not exist.
Without this option, this function returns NULL value instead of child JSON object and also it returns a run time error in "strict" mode.
All modern web applications support JSON and it is one of the well-known data interchange formats. There is no specific data type for JSON SQL Server like XML.
This function is very useful to check input string in JSON format before it stores to the database.