Download presentation
Presentation is loading. Please wait.
Published bySiska Jayadi Modified over 5 years ago
1
{. “speaker”:. “Emanuele Zanchettin”,. “session” :
{ “speaker”: “Emanuele Zanchettin”, “session” : “JSON before and after SQL SERVER 2016” }
2
Sponsors!
3
Agenda
4
Agenda JSON overview Using JSON before SQL Server 2016 Using JSON with/after SQL Server 2016 A real scenario (simplified) Conclusions would you like to play a game?
5
Have you never used JSON before?
Too much early this morning .. a very busy day .. and now .. ?? Are you awake? Try to raise your hand, just one Try to smile Who is using … (raise at least one hand) SQL Server? SS Management Studio? Who is … (raise at least one hand) A developer? A DBAdministrator? Other? Have you never used JSON before?
6
me - Emanuele Zanchettin
15+ years experience about IT Data architect and consultant about SQLServer and Azure SQL Database Lead of Software Sci-Tech Labs Daresbury (UK) Co-founder thinkIT (IT) Community Lead Official Microsoft Community Speaker at national and international conferences and user groups about SQLServer e Azure SQL Database –
7
JSON overview
8
JSON overview - History
In computing, JSON, acronym of JavaScript Object Notation, is an open-standard file format to transmit data using asynchronous browser/server communication Based on STD JS December 1999 Indipendent Alternative of XML
9
JSON overview – data types
Data types supported by this format are: boolean number string array and associative array null object Not supported data types are: binary .. Base64
10
JSON overview – XML vs JSON
XML <employees> <employee> <name>Tim</name> <gender>M</gender> </employee> <name>Tom</name> </employees > JSON { "employees": [ "name": "Tim", "gender": "M" }, "name": "Tom", } ]
11
JSON overview – JSON roles
An object must be included between { and } (braces) Couple keys/values are separated by : (colon) Collections of couple keys/values are separated by , (comma) Arrays are represented by [ ] (square brakets) and values are separated by , (comma)
12
JSON overview – data type conversion
JSON «value» types Number, decimal signed with eventual fraction and exponent E String, delimited by " and managed with \ as escape char Boolean, true or false Null Array, delimited by [] as an empty list or with elements separated by , Object, delimited by { } with eventual couple key/value separated by , Easy, isn’t!?
13
JSON overview – strings
Be careful in case of managing of UNICODE strings, except " and \ and control char, for example \" double quote \\ reverse bar \/ bar \b behind \f end page \r return \n new row \t tab \u<hex 4 digit> any char with hex representation
14
JSON before of SQL Server 2016
15
JSON before of SQL Server 2016
Not native support Are there alternatives? Don’t use JSON at DB level Maintain the JSON as not structured data into the DB Migrate to SQL Server 2016 !?!? Parsing the JSON at DB level .. Accepting all limits .. Enjoy, it’s possible to manage in «easy» mode the JSON using previous versions of SQL Server 2016 …
16
DEMO JSON2014
17
JSON with/after SQL Server 2016
18
JSON with/after SQL Server 2016
Native support OUPUT FOR JSON PATH FOR JSON AUTO INPUT OPENJSON ISJSON JSON_VALUE JSON_QUERY
19
DEMO JSON2016
20
A real scenario (simplified) – do you like wine?
Versions: { // PackageV1 "DeviceIdentifier": null, "Temperatures": null } { // PackageV2 "Temperatures": null, "Version": null { // PackageV3 "Version": null, "Temperature": 0.0, "Humidity": 0.0
21
DEMO WINE
22
Conclusions – only vantages
No setup and/or installation needed Few and easy command to remember Easy to use, to integrate and to maintain Two ways transformation JSON <-> relational model Hibrid model with data storing Total flexibility on JSON structure on data storing Indexes to have better performances
23
Q&A Here, there, around the world
24
Please, don’t forget to complete
Thanks Thank you very much for listening Please, don’t forget to complete the feedback form
26
Agenda JSON overview Using JSON with/after SQL Server 2016
Using JSON before SQL Server 2016 A real scenario (simplified) Conclusions no thanks would you like to play a game?
27
Have you never used JSON before?
Too much early this morning .. a very busy day .. and now .. ?? Are you awake? Try to raise your hand, just one Try to smile Who is using … (raise at least one hand) SQL Server? SS Management Studio? Who is … (raise at least one hand) A developer? A DBAdministrator? Other? Have you never used JSON before?
28
me - Emanuele Zanchettin
15+ years experience about IT Data architect and consultant about SQLServer and Azure SQL Database Lead of Software Sci-Tech Labs Daresbury (UK) Co-founder thinkIT (IT) Community Lead Official Microsoft Community Speaker at national and international conferences and user groups about SQLServer e Azure SQL Database –
29
Conclusions – only vantages
No setup and/or installation needed Few and easy command to remember Easy to use, to integrate and to maintain Two ways transformation JSON <-> relational model Hibrid model with data storing Total flexibility on JSON structure on data storing Indexes to have better performances
30
A real scenario – do you like wine?
Versions: { // PackageV1 "DeviceIdentifier": null, "Temperatures": null } { // PackageV2 "Temperatures": null, "Version": null { // PackageV3 "Version": null, "Temperature": 0.0, "Humidity": 0.0
31
DEMO WINE
32
JSON with/after SQL Server 2016
33
JSON with/after SQL Server 2016
Native support OUPUT FOR JSON PATH FOR JSON AUTO INPUT OPENJSON ISJSON JSON_VALUE JSON_QUERY
34
DEMO JSON2016
35
JSON before of SQL Server 2016
36
JSON before of SQL Server 2016
Not native support Are there alternatives? Don’t use JSON at DB level Maintain the JSON as not structured data into the DB Migrate to SQL Server 2016 !?!? Parsing the JSON at DB level .. Accepting all limits .. Enjoy, it’s possible to manage in «easy» mode the JSON using previous versions of SQL Server 2016 …
37
DEMO JSON2014
38
JSON overview
39
JSON overview - History
In computing, JSON, acronym of JavaScript Object Notation, is an open-standard file format to transmit data using asynchronous browser/server communication Based on STD JS December 1999 Indipendent Alternative of XML
40
JSON overview – data types
Data types supported by this format are: boolean number string array and associative array null object Not supported data types are: binary .. Base64
41
JSON overview – XML vs JSON
XML <employees> <employee> <name>Tim</name> <gender>M</gender> </employee> <name>Tom</name> </employees > JSON { "employees": [ "name": "Tim", "gender": "M" }, "name": "Tom", } ]
42
JSON overview – JSON roles
An object must be included between { and } (braces) Couple keys/values are separated by : (colon) Collections of couple keys/values are separated by , (comma) Arrays are represented by [ ] (square brakets) and values are separated by , (comma)
43
JSON overview – data type conversion
JSON «value» types Number, decimal signed with eventual fraction and exponent E String, delimited by " and managed with \ as escape char Boolean, true or false Null Array, delimited by [] as an empty list or with elements separated by , Object, delimited by { } with eventual couple key/value separated by , Easy, isn’t!?
44
JSON overview – strings
Be careful in case of managing of UNICODE strings, except " and \ and control char, for example \" double quote \\ reverse bar \/ bar \b behind \f end page \r return \n new row \t tab \u<hex 4 digit> any char with hex representation
45
Q&A Here, there, around the world
46
Please, don’t forget to complete
Thanks Thank you very much for listening and playing the game Please, don’t forget to complete the feedback form
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.