SlideShare a Scribd company logo
Introducing JSON
in MS SQL Server
Greg McMurray
Business Solutions Developer
Western Electricity Coordinating Council
Western Electricity Coordinating Council
• Non-profit to ensure the reliability of the western interconnection
• Approved Regional Entity by Federal Energy Regulatory Commission
• Create, monitor & enforce reliability standards
• Publish various models and independent perspective
• Covers 14 western states, 2 Canadian provinces and Baja Mexico
• We are hiring! https://www.wecc.biz/careers
Greg McMurray
• Worked in Aerospace, Branding & Marketing, Energy, Healthcare, Software
• Currently Business Solutions Developer atWECC
• Manager at Aritus Computer Services, L.L.C. for 18 years
• Active in many local user groups
• Find me online
• @goyuix
• https://www.linkedin.com/in/goyuix
• https://stackoverflow.com/cv/goyuix - top 3% of users
Hi! I am Greg – not Jason ↓
JSON? Who is Jason?
• “Discovered” by Douglas Crockford in 2001
• “JSON is XML for young people”
Scott Hanselman
DEVIntersection EU 2015
• Sample JSON:
{“User Group”:”Utah SQL Server Group”} ↑This is Scott - not Jason ↑
JavaScript Object Notation (JSON)
• What is JSON?
• Name-Value pairs
• Only 7 values: string, number, object, array, true, false, null
• Scalar values, objects and arrays - you can actually model a table or dataset quite nicely
• Number type: Supports both integer and floating point, but how they are implemented
is up to the parser.
• It is usually UTF-8 encoded – recommended to use NVARCHAR
Douglas Crockford – also not Jason↓
Want to Learn More About JSON?
• JSON.org is a great quick reference and starting place
• There are RFCs (4627 & 7159) and ECMA standards (404 & partly 262) as
published standards for data exchange
• Validation and schemas exist, not commonly used but are gaining in
popularity
Some JSON Gotchas & Quirks
• So what happens with dates or other complex types?
• Usually a convention of using one of the available types
• Date object might be represented by the ISO 8601 string
• How you do know if it was a string or date? Do you care?
• SQL Server JSON parser defaults to returning NVARCHAR typically
• JSON paths default to lax mode; strict mode changes behaviors
JSON Support in SQL Server
• Requires Compatibility Level 130 (SQL 2016)
• Some functions available at lower levels, but still require Server 2016 engine
• 120 might be the default even in new Azure SQL databases – you really need to check
• Available Functions
• ISJSON - more like IsValid JSON
• JSON_VALUE - for extracting scalar values
• JSON_MODIFY - like find / replace, but structured
• JSON_QUERY - useful for preventing SQL server from double escaping
• OPENJSON - treat JSON documents/objects/arrays as a table
• FOR JSON AUTO / PATH - convert query results to JSON document - similar to FOR XML
• Many functions can use / require a JSON path to identify data
• ProTip:You can use OPENROWSET to read saved JSON files
JSON Paths
• https://msdn.microsoft.com/en-us/library/mt577087.aspx
• String used in when calling various JSON functions
• Has a lax and strict mode; lax is the default
• Specify strict by including it at the start of your path, e.g. ‘strict $.Name’
• Strict mode changes:
• Generally raises errors on any possible parsing issues
• Error out on case-sensitivity issues rather than returning NULL
• Error out on missing keys for JSON_MODIFY, rather than adding them
• There is also an append mode used to add values to a JSON array
ISJSON
• https://msdn.microsoft.com/en-us/library/dn921896.aspx
• Returns 1 if the string contains valid JSON
• Examples:
• SELECT ISJSON('[1,2,3]')
• SELECT ISJSON('<tag>Not JSON</tag>')
• SELECT Id, Fragment FROM DocumentsWHERE ISJSON(Fragment) = 1
JSON_VALUE
• https://msdn.microsoft.com/en-us/library/dn921898.aspx
• Extracts a scalar value from a JSON string
• Examples:
• SELECT JSON_VALUE('{"Group":"SLC SQL UG"}', '$.Group')
• SELECT JSON_VALUE('{"Me":{"Name":"Greg"}}', '$.Me.Name')
JSON_QUERY
• https://msdn.microsoft.com/en-us/library/dn921884.aspx
• Extracts an object or an array from a JSON string
• JSON_VALUE returns scalar values; JSON_QUERY returns objects & arrays
• Examples:
• SELECT JSON_QUERY('{"a":[1,2,3]}', '$.a')
• SELECT JSON_QUERY('{"Me":{"Name":"Greg"}}', '$.Me')
JSON_MODIFY
• https://msdn.microsoft.com/en-us/library/dn921892.aspx
• Updates the value of a property in a JSON string and returns the new JSON
• Benefit: performs some validation and can safely replaces values
• Examples:
• SELECT JSON_MODIFY('{"Name":"Greg"}', '$.Name', 'Gregory')
• SELECT JSON_MODIFY('{"a":[1,2]}', 'append $.a', 3)
OPENJSON
• https://msdn.microsoft.com/en-us/library/dn921885.aspx
• Table-value function that parses JSON text and returns objects and properties as
rows and columns
• Requires COMPATIBILITY_LEVEL >= 130
• Supports defining a schema for JSON document
• Examples:
• SELECT * FROM OPENJSON('{"a":null,"b":1,"c":"2","d":[1,2],"e":{"f":6}}')
FOR JSON
• https://msdn.microsoft.com/en-us/library/ms173812.aspx
• Converts rows and columns to a JSON document
• Uses the FOR JSON syntax (similar to XML)
• Examples:
• SELECT name,object_id from sys.tables FOR JSON AUTO
Computed Columns
• Non-persisted data in the tables
• ProTip:You can build an index on a computed column
• This can be very useful for indexing into your JSON document
• Example:
ALTERTABLE [Table] ADD ColAS JSON_VALUE(JsonData, '$.Field')
Peeking Inside Pages –Table & Index
• Trace flags are your friend again: DBCCTRACEON(3604);
• DBCC IND('Database','dbo.Table',-1);
• DBCC PAGE('Database',FileNum,PagePID,3) WITHTABLERESULTS
• https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-using-
dbcc-page-and-dbcc-ind-to-find-out-if-page-splits-ever-roll-back/
Want to learn more?
• BertWagner
https://blog.bertwagner.com/
• SQL Server 2016 support for JSON
https://msdn.microsoft.com/en-us/library/dn921897.aspx
• JSON in SQL Server (4 Parts)
https://blogs.technet.microsoft.com/dataplatforminsider/2016/01/05/json-in-sql-
server-2016-part-1-of-4/
• JSON on MSDN Channel 9
https://channel9.msdn.com/Search?term=JSON
Questions and Discussion
• Did I introduce everything you hoped to learn today?
• Would you like any clarifications on something we covered?
• Share with us: How are you going to apply this is your world?
• Feel free to reach out to me online:
• Twitter: @goyuix
• LinkedIn: https://www.linkedin.com/in/goyuix

More Related Content

What's hot (20)

PDF
SQL vs. NoSQL Databases
Osama Jomaa
 
PPTX
Day 4 - Models
Barry Jones
 
PDF
SDEC2011 NoSQL Data modelling
Korea Sdec
 
PDF
Cassandra
Robert Koletka
 
KEY
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Alex Nguyen
 
PPTX
Modeling JSON data for NoSQL document databases
Ryan CrawCour
 
PDF
Elastic Search
Lukas Vlcek
 
PPTX
Introduction to mongo db
NexThoughts Technologies
 
PPTX
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 
PDF
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
PDF
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
Edureka!
 
PPTX
MongoDB basics & Introduction
Jerwin Roy
 
PPT
Jsp + My Sql
Ashwin K
 
PPTX
PostgreSQL - It's kind've a nifty database
Barry Jones
 
PPTX
NoSQL Tel Aviv Meetup#1: NoSQL Data Modeling
NoSQL TLV
 
PDF
Apache Any23 - Anything to Triples
Michele Mostarda
 
PPT
Mysql grand
Siddique Ibrahim
 
PPTX
Dataweave
Bhoopal Kante
 
SQL vs. NoSQL Databases
Osama Jomaa
 
Day 4 - Models
Barry Jones
 
SDEC2011 NoSQL Data modelling
Korea Sdec
 
Cassandra
Robert Koletka
 
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Alex Nguyen
 
Modeling JSON data for NoSQL document databases
Ryan CrawCour
 
Elastic Search
Lukas Vlcek
 
Introduction to mongo db
NexThoughts Technologies
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
Edureka!
 
MongoDB basics & Introduction
Jerwin Roy
 
Jsp + My Sql
Ashwin K
 
PostgreSQL - It's kind've a nifty database
Barry Jones
 
NoSQL Tel Aviv Meetup#1: NoSQL Data Modeling
NoSQL TLV
 
Apache Any23 - Anything to Triples
Michele Mostarda
 
Mysql grand
Siddique Ibrahim
 
Dataweave
Bhoopal Kante
 

Similar to Sql Server 2016 and JSON (20)

PDF
Native JSON Support in SQL2016
Ivo Andreev
 
PPTX
Azure SQL & SQL Server 2016 JSON
Davide Mauri
 
PPTX
SQL Server 2016 JSON
Davide Mauri
 
PPTX
JSON-SQLServer2016.pptx dgsdgdsgdsgdsgsdgdsgdsg
zmulani8
 
PPTX
Demystifying JSON in SQL Server
kristinferrier
 
PDF
JSON Support in DB2 for z/OS
Jane Man
 
PPTX
DBAs vs Developers: JSON in SQL Server - CBusPASS
Bert Wagner
 
PPTX
DBAs vs Developers - JSON in SQL Server
Bert Wagner
 
PPTX
JSON in SQL Server 2016
Bert Wagner
 
PPTX
DBAs vs Developers: JSON in SQL Server
Bert Wagner
 
PPTX
[Eng] Sql Saturday TorinoExpo - Sql Server 2016 JSON support
Alessandro Alpi
 
PPTX
JSON as a SQL Datatype
Robert Sell
 
PDF
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Jumping Bean
 
PDF
There is Javascript in my SQL
PGConf APAC
 
PPTX
BGOUG15: JSON support in MySQL 5.7
Georgi Kodinov
 
PPSX
Json in 18c and 19c
stewashton
 
PDF
Json in Postgres - the Roadmap
EDB
 
PDF
How to Use JSON in MySQL Wrong
Karwin Software Solutions LLC
 
PPTX
MySQL Rises with JSON Support
Okcan Yasin Saygılı
 
PPTX
Power JSON with PostgreSQL
EDB
 
Native JSON Support in SQL2016
Ivo Andreev
 
Azure SQL & SQL Server 2016 JSON
Davide Mauri
 
SQL Server 2016 JSON
Davide Mauri
 
JSON-SQLServer2016.pptx dgsdgdsgdsgdsgsdgdsgdsg
zmulani8
 
Demystifying JSON in SQL Server
kristinferrier
 
JSON Support in DB2 for z/OS
Jane Man
 
DBAs vs Developers: JSON in SQL Server - CBusPASS
Bert Wagner
 
DBAs vs Developers - JSON in SQL Server
Bert Wagner
 
JSON in SQL Server 2016
Bert Wagner
 
DBAs vs Developers: JSON in SQL Server
Bert Wagner
 
[Eng] Sql Saturday TorinoExpo - Sql Server 2016 JSON support
Alessandro Alpi
 
JSON as a SQL Datatype
Robert Sell
 
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Jumping Bean
 
There is Javascript in my SQL
PGConf APAC
 
BGOUG15: JSON support in MySQL 5.7
Georgi Kodinov
 
Json in 18c and 19c
stewashton
 
Json in Postgres - the Roadmap
EDB
 
How to Use JSON in MySQL Wrong
Karwin Software Solutions LLC
 
MySQL Rises with JSON Support
Okcan Yasin Saygılı
 
Power JSON with PostgreSQL
EDB
 
Ad

More from Greg McMurray (11)

PPTX
Power Platform Introduction - Utah PowerApps and Flow User Group
Greg McMurray
 
PPTX
SharePoint Search - August 2019 at Utah SharePoint User Group
Greg McMurray
 
PPTX
PowerShell Basics for Office Apps and Servers
Greg McMurray
 
PPTX
Introduction to SQL Server Graph DB
Greg McMurray
 
PPTX
Power BI Streaming Datasets - San Diego BI Users Group
Greg McMurray
 
PPTX
Dynamics 365 Web API - CRMUG April 2018
Greg McMurray
 
PPTX
SQL Server Temporal Tables
Greg McMurray
 
PPTX
Power BI Streaming Datasets
Greg McMurray
 
PPTX
Introduction to Microsoft Teams
Greg McMurray
 
PPTX
CRMUG Presentation on Dynamics CRM integration with SharePoint
Greg McMurray
 
PPTX
Real World Power Query for Excel and Power BI - SQL Saturday #576
Greg McMurray
 
Power Platform Introduction - Utah PowerApps and Flow User Group
Greg McMurray
 
SharePoint Search - August 2019 at Utah SharePoint User Group
Greg McMurray
 
PowerShell Basics for Office Apps and Servers
Greg McMurray
 
Introduction to SQL Server Graph DB
Greg McMurray
 
Power BI Streaming Datasets - San Diego BI Users Group
Greg McMurray
 
Dynamics 365 Web API - CRMUG April 2018
Greg McMurray
 
SQL Server Temporal Tables
Greg McMurray
 
Power BI Streaming Datasets
Greg McMurray
 
Introduction to Microsoft Teams
Greg McMurray
 
CRMUG Presentation on Dynamics CRM integration with SharePoint
Greg McMurray
 
Real World Power Query for Excel and Power BI - SQL Saturday #576
Greg McMurray
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 

Sql Server 2016 and JSON

  • 1. Introducing JSON in MS SQL Server Greg McMurray Business Solutions Developer Western Electricity Coordinating Council
  • 2. Western Electricity Coordinating Council • Non-profit to ensure the reliability of the western interconnection • Approved Regional Entity by Federal Energy Regulatory Commission • Create, monitor & enforce reliability standards • Publish various models and independent perspective • Covers 14 western states, 2 Canadian provinces and Baja Mexico • We are hiring! https://www.wecc.biz/careers
  • 3. Greg McMurray • Worked in Aerospace, Branding & Marketing, Energy, Healthcare, Software • Currently Business Solutions Developer atWECC • Manager at Aritus Computer Services, L.L.C. for 18 years • Active in many local user groups • Find me online • @goyuix • https://www.linkedin.com/in/goyuix • https://stackoverflow.com/cv/goyuix - top 3% of users Hi! I am Greg – not Jason ↓
  • 4. JSON? Who is Jason? • “Discovered” by Douglas Crockford in 2001 • “JSON is XML for young people” Scott Hanselman DEVIntersection EU 2015 • Sample JSON: {“User Group”:”Utah SQL Server Group”} ↑This is Scott - not Jason ↑
  • 5. JavaScript Object Notation (JSON) • What is JSON? • Name-Value pairs • Only 7 values: string, number, object, array, true, false, null • Scalar values, objects and arrays - you can actually model a table or dataset quite nicely • Number type: Supports both integer and floating point, but how they are implemented is up to the parser. • It is usually UTF-8 encoded – recommended to use NVARCHAR Douglas Crockford – also not Jason↓
  • 6. Want to Learn More About JSON? • JSON.org is a great quick reference and starting place • There are RFCs (4627 & 7159) and ECMA standards (404 & partly 262) as published standards for data exchange • Validation and schemas exist, not commonly used but are gaining in popularity
  • 7. Some JSON Gotchas & Quirks • So what happens with dates or other complex types? • Usually a convention of using one of the available types • Date object might be represented by the ISO 8601 string • How you do know if it was a string or date? Do you care? • SQL Server JSON parser defaults to returning NVARCHAR typically • JSON paths default to lax mode; strict mode changes behaviors
  • 8. JSON Support in SQL Server • Requires Compatibility Level 130 (SQL 2016) • Some functions available at lower levels, but still require Server 2016 engine • 120 might be the default even in new Azure SQL databases – you really need to check • Available Functions • ISJSON - more like IsValid JSON • JSON_VALUE - for extracting scalar values • JSON_MODIFY - like find / replace, but structured • JSON_QUERY - useful for preventing SQL server from double escaping • OPENJSON - treat JSON documents/objects/arrays as a table • FOR JSON AUTO / PATH - convert query results to JSON document - similar to FOR XML • Many functions can use / require a JSON path to identify data • ProTip:You can use OPENROWSET to read saved JSON files
  • 9. JSON Paths • https://msdn.microsoft.com/en-us/library/mt577087.aspx • String used in when calling various JSON functions • Has a lax and strict mode; lax is the default • Specify strict by including it at the start of your path, e.g. ‘strict $.Name’ • Strict mode changes: • Generally raises errors on any possible parsing issues • Error out on case-sensitivity issues rather than returning NULL • Error out on missing keys for JSON_MODIFY, rather than adding them • There is also an append mode used to add values to a JSON array
  • 10. ISJSON • https://msdn.microsoft.com/en-us/library/dn921896.aspx • Returns 1 if the string contains valid JSON • Examples: • SELECT ISJSON('[1,2,3]') • SELECT ISJSON('<tag>Not JSON</tag>') • SELECT Id, Fragment FROM DocumentsWHERE ISJSON(Fragment) = 1
  • 11. JSON_VALUE • https://msdn.microsoft.com/en-us/library/dn921898.aspx • Extracts a scalar value from a JSON string • Examples: • SELECT JSON_VALUE('{"Group":"SLC SQL UG"}', '$.Group') • SELECT JSON_VALUE('{"Me":{"Name":"Greg"}}', '$.Me.Name')
  • 12. JSON_QUERY • https://msdn.microsoft.com/en-us/library/dn921884.aspx • Extracts an object or an array from a JSON string • JSON_VALUE returns scalar values; JSON_QUERY returns objects & arrays • Examples: • SELECT JSON_QUERY('{"a":[1,2,3]}', '$.a') • SELECT JSON_QUERY('{"Me":{"Name":"Greg"}}', '$.Me')
  • 13. JSON_MODIFY • https://msdn.microsoft.com/en-us/library/dn921892.aspx • Updates the value of a property in a JSON string and returns the new JSON • Benefit: performs some validation and can safely replaces values • Examples: • SELECT JSON_MODIFY('{"Name":"Greg"}', '$.Name', 'Gregory') • SELECT JSON_MODIFY('{"a":[1,2]}', 'append $.a', 3)
  • 14. OPENJSON • https://msdn.microsoft.com/en-us/library/dn921885.aspx • Table-value function that parses JSON text and returns objects and properties as rows and columns • Requires COMPATIBILITY_LEVEL >= 130 • Supports defining a schema for JSON document • Examples: • SELECT * FROM OPENJSON('{"a":null,"b":1,"c":"2","d":[1,2],"e":{"f":6}}')
  • 15. FOR JSON • https://msdn.microsoft.com/en-us/library/ms173812.aspx • Converts rows and columns to a JSON document • Uses the FOR JSON syntax (similar to XML) • Examples: • SELECT name,object_id from sys.tables FOR JSON AUTO
  • 16. Computed Columns • Non-persisted data in the tables • ProTip:You can build an index on a computed column • This can be very useful for indexing into your JSON document • Example: ALTERTABLE [Table] ADD ColAS JSON_VALUE(JsonData, '$.Field')
  • 17. Peeking Inside Pages –Table & Index • Trace flags are your friend again: DBCCTRACEON(3604); • DBCC IND('Database','dbo.Table',-1); • DBCC PAGE('Database',FileNum,PagePID,3) WITHTABLERESULTS • https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-using- dbcc-page-and-dbcc-ind-to-find-out-if-page-splits-ever-roll-back/
  • 18. Want to learn more? • BertWagner https://blog.bertwagner.com/ • SQL Server 2016 support for JSON https://msdn.microsoft.com/en-us/library/dn921897.aspx • JSON in SQL Server (4 Parts) https://blogs.technet.microsoft.com/dataplatforminsider/2016/01/05/json-in-sql- server-2016-part-1-of-4/ • JSON on MSDN Channel 9 https://channel9.msdn.com/Search?term=JSON
  • 19. Questions and Discussion • Did I introduce everything you hoped to learn today? • Would you like any clarifications on something we covered? • Share with us: How are you going to apply this is your world? • Feel free to reach out to me online: • Twitter: @goyuix • LinkedIn: https://www.linkedin.com/in/goyuix