What will be the result?

You are a database developer on an instance of SQL Server 2008. Your Sales database contains sales and marketing information for your company. You receive an XML file in the following format that contains leads from sales representatives in the field:
<LeadData>
<Salesperson ID="45">
<DailyLeads>
<Leads ID="22" InitDate="2009-01-07" >
<Company Name="NuTex Corporation" EstRev="40000" />
<Company Name="Verigon Inc." EstRev="125000" />
</Leads>
</DailyLeads>
</Salesperson>
<Salesperson ID="82">
<DailyLeads>
<Leads ID="29" InitDate="2009-02-12" >
<Company Name="VisionWorx" EstRev="500000" />
<Company Name="InterConn" EstRev="187000" />
</Leads>
</DailyLeads>
</Salesperson>
</LeadData>
You load the XML into an xml variable named @x and execute the following Transact-SQL:
EXEC sp_xml_preparedocument @idoc OUTPUT, @x
SELECT * INTO dbo.SalesLeads
FROM OPENXML(@idoc, ‘LeadData/Salesperson’, 1)
WITH (ID int, Leads xml ‘DailyLeads’);
EXEC sp_xml_removedocument @idoc;
What will be the result?
A. An XML document is created containing each salesperson’s leads.
B. A single row is inserted into the SalesLeads table.
C. Multiple rows are inserted into the SalesLeads table.
D. The statement fails because the OPENXML function is incorrectly specified.

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.