70-433 · Question #15
Click the Exhibit button. You have the following XML: </Site> </Site> </Site> You are tasked to query the sites listed in the XML by using OPENXML. The results will have two columns, ParentSiteURL…
The correct answer is C. SELECT ParentSiteURL, SiteURL. DECLARE @XMLDocHandle int, @XMLDoc varchar(1000) =' --Create an internal representation of the XML document. EXEC sp_xml_preparedocument @XMLDocHandle OUTPUT, @XMLDoc SELECT ParentSiteURL, SiteURL FROM OPENXML (@XMLDocHandle, '//Site', 1) WITH ( ParentSiteURL nVarChar(512)…
Question
Click the Exhibit button. You have the following XML:
</Site> </Site> </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 that in the exhibit. You need to write the OPENXML query. Which Transact-SQL statement should you use?
Exhibit
Options
- ASELECT ParentSiteURL, SiteURL
- BSELECT ParentSiteURL, SiteURL
- CSELECT ParentSiteURL, SiteURL
- DSELECT ParentSiteURL, SiteURL
How the community answered
(62 responses)- A10% (6)
- B2% (1)
- C84% (52)
- D5% (3)
Explanation
DECLARE @XMLDocHandle int, @XMLDoc varchar(1000) =' --Create an internal representation of the XML document. EXEC sp_xml_preparedocument @XMLDocHandle OUTPUT, @XMLDoc SELECT ParentSiteURL, SiteURL FROM OPENXML (@XMLDocHandle, '//Site', 1) WITH ( ParentSiteURL nVarChar(512) '../@URL', SiteURL nVarChar(512) '@URL')
Topics
Community Discussion
No community discussion yet for this question.
