©  Alex Grinberg 2018
Alex GrinbergXML and JSON Recipes for SQL Serverhttps://doi.org/10.1007/978-1-4842-3117-3_3

3. Manipulating XML Files

Alex Grinberg1 
(1)
Richboro, Pennsylvania, USA
 

In Chapter 2, we discussed how to build XML from an SQL query result set. Before we begin reviewing the options on how to shred XML data, we first need to know how to store the XML result on the storage (disk, SSD drive, SAN, etc.) and how to upload an XML file into a table. This chapter will demonstrate the various options to manipulate the XML files.

3-1. Storing XML Result in a File from SQL

Problem

You want to store the XML result you generate in SQL as an .xml file.

Solution

The BCP (bulk copy program) utility allows the export of data into an XML file. When the ...

Get XML and JSON Recipes for SQL Server: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.