Which statement will successfully update the VendorName attribute of the element in the Details column?

You are a database developer on an instance of SQL Server 2008. You have a POMaster table that contains an xml data type column named Details as shown:


An error occurred in the application that captures and records purchase details, and you need to update the Details column in the POMaster table. The Details column in the table currently contains the following XML for PurchaseOrderID 2006:
<POLines PONum="25" VendorName="VisionWorx">
<POLine>
<InvID>026</InvID>
<Quantity>7</Quantity>
<Cost>32.95</Cost>
<Taxable>1</Taxable>
</POLine>
<POLine>
<InvID>022</InvID>
<Quantity>142</Quantity>
<Cost>2.95</Cost>
<Taxable>1</Taxable>
</POLine>
</POLines>
You need to update the VendorName attribute in the XML to correct the error.
SET Details.modify(‘insert(/POLines[@VendorName="VisionWorx Corporation"]/@VendorName) [1] ‘)WHERE PurchaseOrderID = 2006;
Which statement will successfully update the VendorName attribute of the <POLines> element in the Details column?
A. UPDATE POMaster
SET Details.modify(‘/POLines[@VendorName="VisionWorx"]/@VendorName) ="VisionWorx Corporation"’)WHERE PurchaseOrderID = 2006;
B. UPDATE POMaster
SET Details.modify(‘replace value of(/POLines[@VendorName="VisionWorx"]/@VendorName)
C. UPDATE POMaster
SET Details.modify(‘replace value of(/POLines[@VendorName="VisionWorx"]/@VendorName)[1] with "VisionWorx Corporation"
‘)WHERE PurchaseOrderID = 2006;
D. UPDATE POMaster
SET Details.modify(‘/POLines[@VendorName="VisionWorx"]/@VendorName)[1] with "VisionWorx Corporation" ‘)WHERE
PurchaseOrderID = 2006;

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.