Which Transact-SQL statement should you use?

You have the following xml:
<Site URL="http://www.contoso.com/index.htm">
<Site URL="http://www.contoso.com/finance/index.htm">
<Site URL="http://www.contoso.com/finance/reports/index.htm" />
<Site URL="http://www.contoso.com/finance/main/index.htm" />
</Site>
<Site URL="http://www.contoso.com/marketing/index.htm">
<Site URL="http://www.contoso.com/marketing/reports/index.htm" />
<Site URL="http://www.contoso.com/marketing/main/index.htm" />
</Site>
<Site URL="http://www.contoso.com/sales/index.htm" /></Site>
You are tasked to query the sites listed in the xml by using OPENXML.
The results will have two columns, ParentSiteURL and SiteURL.
The ParentSiteURL column should contain the URL attribute of the parent site.
The SiteURL column should contain the URL attribute of the site itself.
The output should look like as shown in the following the exhibit. (Click the Exhibit button.)
You need to write the OPENXML query.
Which Transact-SQL statement should you use?
Exhibit:


Exhibit:
A. SELECT ParentSiteURL, SiteURL
FROM OPENXML (@XMLDocHandle, ‘//@URL’, 1)
WITH (ParentSiteURL nVarChar(512) ‘../URL’,SiteURL nVarChar(512) ‘URL’)
B. SELECT ParentSiteURL, SiteURL
FROM OPENXML (@XMLDocHandle, ‘//URL’, 1)
WITH (ParentSiteURL nVarChar(512) ‘../@URL’,SiteURL nVarChar(512) ‘@URL’)
C. SELECT ParentSiteURL, SiteURL
FROM OPENXML (@XMLDocHandle, ‘//@Site’, 1)
WITH (ParentSiteURL nVarChar(512) ‘../URL’,SiteURL nVarChar(512) ‘URL’)
D. SELECT ParentSiteURL, SiteURL
FROM OPENXML (@XMLDocHandle, ‘//Site’, 1)
WITH (ParentSiteURL nVarChar(512) ‘../@URL’,SiteURL nVarChar(512) ‘@URL’)

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.