Muutke küpsiste eelistusi

E-raamat: XML and JSON Recipes for SQL Server: A Problem-Solution Approach

  • Formaat - PDF+DRM
  • Hind: 67,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Quickly find solutions to dozens of common problems encountered while using XML and JSON features that are built into SQL Server. Content is presented in the popular problem-solution format. Look up the problem that you want to solve. Read the solution. Apply the solution directly in your own code. Problem solved!

This book shows how to take advantage of XML and JSON to share data and automate tasks. JSON is commonly used to move data back and forth between the database and front-end applications, often running in a browser. This book shows all you need to know about transforming query results into JSON format, and back again. Also covered are the processes and techniques for moving data into and out of XML format for business intelligence and other purposes, such as when transferring data from a reporting system into a data warehouse, or between different database brands such as between SQL Server and Oracle.

Microsoft intensively implements XML in SQL Server, and in many related products. Execution plans are generated in XML format, and this book shows you how to parse those plans and automate the detection of performance problems. The relatively new Extended Events feature writes tracing data into XML files, and the recipes in this book help in parsing those files.

XML is also used in SQL Server's BI tool set, including in SSIS, SSR, and SSAS. XML is used in many configuration files, and is even behind the construction of DDL triggers. In reading this book you’ll dive deeply into the features that allow you to build and parse XML, and also JSON, which is a specific format of XML used to transmit objects in a web-friendly format between a database and its front-end applications.

What You Will Learn
  • Build XML and JSON objects in support of automation and data transfer
  • Import and parse XML and JSON from operating system files
  • Build appropriate indexes on XML objects to improve query performance
  • Move data from query result sets into JSON format, and back again
  • Automate the detection of database performance problems by querying and parsing the database’s own execution plans
  • Replace external and manual JSON processes with SQL Server's internal, JSON functionality
Who This Book Is For

Database administrators, .NET developers, business intelligence developers, and other professionals who want a deep and detailed skill set around working with XML and JSON in a SQL Server database environment. Web developers will particularly find the book useful for its coverage of transforming database result sets into JSON text that can be transmitted to front-end web applications.



Tagline: Ready-to-run solutions for busy developers
About the Author xix
About the Technical Reviewer xxi
Acknowledgments xxiii
Part I XML in SQL Server
1(218)
Chapter 1 Introducing XML
3(20)
Stepping into XML
3(5)
Sample Database
4(1)
Understanding XML
4(2)
Entitizing XML Characters
6(1)
Exploring the XML Data Type
7(1)
1-1 Creating an Untyped XML Column
8(3)
Problem
8(1)
Solution
8(2)
How It Works
10(1)
1-2 Creating an XML Schema in Visual Studio
11(3)
Problem
11(1)
Solution
11(2)
How It Works
13(1)
1-3 Creating an XML Schema from SSMS
14(4)
Problem
14(1)
Solution
15(1)
How It Works
16(2)
1-4 Binding XML to a Schema Collection
18(2)
Problem
18(1)
Solution
18(1)
How It Works
19(1)
1-5 Creating a Typed XML Column
20(2)
Problem
20(1)
Solution
21(1)
How It Works
21(1)
Summary
22(1)
Chapter 2 Building XML
23(30)
Fixing the "Unable to show XML" Error
24(2)
2-1 Converting Relational Data to a Simple XML Format
26(2)
Problem
26(1)
Solution
26(1)
How It Works
26(2)
2-2 Generating XML Data with Table Names as Element Names
28(2)
Problem
28(1)
Solution
28(2)
How It Works
30(1)
2-3 Generating Element-Centric XML
30(2)
Problem
30(1)
Solution
31(1)
How It Works
31(1)
2-4 Adding a Root Element
32(1)
Problem
32(1)
Solution
32(1)
How It Works
33(1)
2-5 Including Elements with NULL Values in Your XML Data
33(1)
Problem
33(1)
Solution
33(1)
How It Works
34(1)
2-6 Including Binary Data in Your XML
34(2)
Problem
34(1)
Solution
34(1)
How It Works
35(1)
2-7 Generating Nested Hierarchical XML Data
36(2)
Problem
36(1)
Solution
36(2)
How It Works
38(1)
2-8 Building Custom XML
38(7)
Problem
38(1)
Solution
38(2)
How It Works
40(5)
2-9 Simplifying Custom XML Generation
45(3)
Problem
45(1)
Solution
45(1)
How It Works
46(2)
2-10 Adding Special Nodes to Your XML
48(3)
Problem
48(1)
Solution
48(1)
How It Works
49(2)
Summary
51(2)
Chapter 3 Manipulating XML Files
53(48)
3-1 Storing XML Result in a File from SQL
53(6)
Problem
53(1)
Solution
53(2)
How It Works
55(4)
3-2 Creating XML from an SSIS Package
59(13)
Problem
59(1)
Solution
59(13)
How It Works
72(1)
3-3 Loading XML from a Stored Procedure
72(6)
Problem
72(1)
Solution
72(3)
How It Works
75(3)
3-4 Loading XML from SSIS Package
78(14)
Problem
78(1)
Solution
78(12)
How It Works
90(2)
3-5 Implementing a CLR Solution
92(7)
Problem
92(1)
Solution
92(4)
How It Works
96(3)
Summary
99(2)
Chapter 4 Shredding XML
101(34)
4-1 Shredding XML with Internal ENTITY Declarations
101(7)
Problem
101(1)
Solution
101(1)
How It Works
102(6)
4-2 Migrating OPENXML into XQuery
108(5)
Problem
108(1)
Solution
108(1)
How It Works
109(4)
4-3 Shredding XML from a Column
113(3)
Problem
113(1)
Solution
113(1)
How It Works
114(2)
4-4 Dealing with Legacy XML Storage
116(4)
Problem
116(1)
Solution
117(1)
How It Works
118(2)
4-5 Navigating Typed XML Columns
120(3)
Problem
120(1)
Solution
120(2)
How It Works
122(1)
4-6 Retrieving a Subset of Your XML Data
123(4)
Problem
123(1)
Solution
123(1)
How It Works
124(3)
4-7 Finding All XML Columns in a Table
127(5)
Problem
127(1)
Solution
127(2)
How It Works
129(3)
4-8 Using Multiple CROSS APPLY Operators
132(2)
Problem
132(1)
Solution
132(1)
How It Works
133(1)
Summary
134(1)
Chapter 5 Modifying XML
135(22)
5-1 Inserting a Child Element into Your XML
135(2)
Problem
135(1)
Solution
135(1)
How It Works
136(1)
5-2 Inserting a Child Element into an Existing XML Instance with Namespace
137(3)
Problem
137(1)
Solution
137(1)
How It Works
138(2)
5-3 Inserting XML Attributes
140(3)
Problem
140(1)
Solution
140(1)
How It Works
141(2)
5-4 Inserting XML Attribute Conditionally
143(1)
Problem
143(1)
Solution
143(1)
How It Works
144(1)
5-5 Inserting a Child Element with Position Specification
144(2)
Problem
144(1)
Solution
144(2)
How It Works
146(1)
5-6 Inserting Multiple Elements
146(2)
Problem
146(1)
Solution
146(1)
How It Works
147(1)
5-7 Updating an XML Element Value
148(2)
Problem
148(1)
Solution
148(1)
How It Works
149(1)
5-8 Updating XML Attribute Value
150(1)
Problem
150(1)
Solution
150(1)
How It Works
151(1)
5-9 Deleting an XML Attribute
151(2)
Problem
151(1)
Solution
151(1)
How It Works
152(1)
5-10 Deleting an XML Element
153(3)
Problem
153(1)
Solution
153(1)
How It Works
154(2)
Summary
156(1)
Chapter 6 Filtering XML
157(28)
6-1 Implementing the exist() Method
157(3)
Problem
157(1)
Solution
157(1)
How It Works
158(2)
6-2 Filtering an XML Value with the exist() Method
160(4)
Problem
160(1)
Solution
160(1)
How It Works
161(3)
6-3 Finding All Occurrences of an XML Element Anywhere Within an XML Instance
164(3)
Problem
164(1)
Solution
164(2)
How It Works
166(1)
6-4 Filtering by Single Value
167(1)
Problem
167(1)
Solution
167(1)
How It Works
168(1)
6-5 Filtering XML by T-SQL Variable
168(2)
Problem
168(1)
Solution
168(1)
How It Works
169(1)
6-6 Comparing to a Sequence of Values
170(1)
Problem
170(1)
Solution
170(1)
How It Works
171(1)
6-7 Matching a Specified String Pattern
171(3)
Problem
171(1)
Solution
172(1)
How It Works
172(2)
6-8 Filtering a Range of Values
174(1)
Problem
174(1)
Solution
174(1)
How It Works
175(1)
6-9 Filtering by Multiple Conditions
175(2)
Problem
175(1)
Solution
175(1)
How It Works
176(1)
6-10 Setting a Negative Predicate
177(1)
Problem
177(1)
Solution
177(1)
How It Works
178(1)
6-11 Filtering Empty Values
178(4)
Problem
178(1)
Solution
179(1)
How It Works
180(2)
Summary
182(3)
Chapter 7 Improving XML Performance
185(34)
7-1 Creating a Primary XML Index
185(8)
Problem
185(1)
Solution
185(2)
How It Works
187(6)
7-2 Creating a Secondary PATH Type Index
193(3)
Problem
193(1)
Solution
193(2)
How It Works
195(1)
7-3 Creating a Secondary VALUE Type Index
196(4)
Problem
196(1)
Solution
196(2)
How It Works
198(2)
7-4 Creating a Secondary PROPERTY Type Index
200(2)
Problem
200(1)
Solution
200(2)
How It Works
202(1)
7-5 Creating a Selective XML Index
202(8)
Problem
202(1)
Solution
203(2)
How It Works
205(5)
7-6 Optimizing a Selective XML Index
210(3)
Problem
210(1)
Solution
210(1)
How It Works
211(2)
7-7 Creating a Secondary Selective XML Index
213(2)
Problem
213(1)
Solution
213(1)
How It Works
214(1)
7-8 Modifying Selective XML Indexes
215(3)
Problem
215(1)
Solution
215(2)
How It Works
217(1)
Wrapping up
218(1)
Part II JSON in SQL Server
219(68)
Chapter 8 Constructing JSON
221(24)
JSON Introduction
221(4)
8-1 Building JSON with AUTO Mode
225(5)
Problem
225(1)
Solution
225(1)
How It Works
226(4)
8-2 Handling NULL When JSON Build
230(2)
Problem
230(1)
Solution
230(1)
How It Works
231(1)
8-3 Escaping the Brackets for JSON Output
232(1)
Problem
232(1)
Solution
232(1)
How It Works
232(1)
8-4 Adding ROOT Key Element to JSON
233(1)
Problem
233(1)
Solution
233(1)
How It Works
233(1)
8-5 Gaining Control over JSON Output
234(5)
Problem
234(1)
Solution
234(1)
How It Works
235(4)
8-6 Handling Escape Characters
239(2)
Problem
239(1)
Solution
239(1)
How It Works
240(1)
8-7 Dealing with CLR Data Types
241(3)
Problem
241(1)
Solution
242(1)
How It Works
243(1)
Summary
244(1)
Chapter 9 Converting JSON to Row Sets
245(24)
9-1 Detecting the Columns with JSON
245(4)
Problem
245(1)
Solution
245(2)
How It Works
247(2)
9-2 Returning a Subset of a JSON Document
249(2)
Problem
249(1)
Solution
249(1)
How It Works
250(1)
9-3 Returning a Scalar Value from JSON
251(3)
Problem
251(1)
Solution
251(1)
How It Works
252(2)
9-4 Troubleshooting a Returned NULL
254(1)
Problem
254(1)
Solution
254(1)
How It Works
254(1)
9-5 Converting JSON into a Table
255(4)
Problem
255(1)
Solution
255(1)
How It Works
256(3)
9-6 Processing JSON Nested Sub-Objects
259(4)
Problem
259(1)
Solution
259(3)
How It Works
262(1)
9-7 Indexing JSON
263(4)
Problem
263(1)
Solution
263(1)
How It Works
264(3)
Summary
267(2)
Chapter 10 Modifying JSON
269(18)
10-1 Adding a New Key-Value Pair to JSON
269(1)
Problem
269(1)
Solution
269(1)
How It Works
270(1)
10-2 Updating Existing JSON
270(1)
Problem
270(1)
Solution
270(1)
How It Works
271(1)
10-3 Deleting from JSON
271(2)
Problem
271(1)
Solution
271(1)
How It Works
271(2)
10-4 Appending a JSON Property
273(1)
Problem
273(1)
Solution
273(1)
How It Works
274(1)
10-5 Modifying with Multiple Actions
274(1)
Problem
274(1)
Solution
274(1)
How It Works
275(1)
10-6 Renaming a JSON Key
275(2)
Problem
275(1)
Solution
275(1)
How It Works
276(1)
10-7 Modifying a JSON Object
277(2)
Problem
277(1)
Solution
277(1)
How It Works
277(2)
10-8 Comparing XML vs. JSON
279(6)
Problem
279(1)
Solution
279(4)
How It Works
283(2)
Wrapping Up
285(2)
Index 287
Alex Grinberg has more than 20 years of IT experience. His primary focus is on the latest Microsoft technologies, including .NET (VB and C#), SSRS, and SSIS. He provides tuning, optimization, analysis, and development services toward creating new applications, converting legacy applications into newer technologies such as SQL Server, VB.NET and C#, and toward onsite training. Alex is a senior DBA architect at Cox Automotive Inc. He provides consulting services for the New York City, Philadelphia and Delaware area.