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 ...