Database Reference
In-Depth Information
select Person.Contact.Title, Person.Contact.FirstName, Person.Contact.LastNamefrom
Person.Contact
where Person.Contact.Title ='Mr.'
for xml raw ('PersonDetails'), elements
2.
You will see a link in the results pane of the query pane. Click the link, and you
should see the results in Figure 7-3.
Figure 7-3.
Renaming the
row
element
How It Works
RAW ('alias')
mode produces output where the
row
element is renamed into the alias specified in the
query.
Because the
ELEMENTS
directive is added in the query, the result is element-centric, which is why the
row
element is renamed with the alias specified. If you don't add the
ELEMENTS
keyword in the query, then
the output will be attribute-centric, and the
row
element will be renamed to the alias specified in the
query.