Title: SQL Server-XML-Lesson 2-Adding xmlSchema to ‘for xml’
Duration: 18 minutes
Summary: In this video, we continue our discussion of using XML in SQL Server. We add xmlSchema to ‘for xml’ so that we can see the schema definition with the result. Another option with ‘for xml’ is ‘path’. We used this option to rearrange some of the data we are reading from the Address table before displaying them on the screen. Then we moved to using OpenXML. OpenXML is a powerful functionality that allows us to read some xml data, shred them and insert them into a table. In this case, we read employee data from an xml variable and added them to the Employees table.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: XML and SQL Server 2008
Keywords: XML, for, auto, elements, top, path, select, from, database, varchar, sp_xml_preparedocument, sp_xml_removedocument, openxml, output.