Abstract
T-SQL allows you to convert relational results sets into XML, by using the FOR XML clause in your SELECT statement. There are four modes that can be used with the FOR XML clause; FOR XML RAW, FOR XML AUTO, FOR XML PATH, and FOR XML EXPLICIT. This chapter will demonstrate how the FOR XML clause works in RAW mode, AUTO mode, PATH mode, and EXPLICIT mode. As the chapter progresses, we will move from simple to more complex examples.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Peter A. Carter
About this chapter
Cite this chapter
Carter, P.A. (2018). Constructing XML with T-SQL. In: SQL Server Advanced Data Types. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3901-8_3
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3901-8_3
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3900-1
Online ISBN: 978-1-4842-3901-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books