Code example 18-1 <Error ErrorNumber = 6901> <ErrorSeverity>16</ErrorNumber> <Er
ID: 3715259 • Letter: C
Question
Code example 18-1
<Error ErrorNumber = 6901>
<ErrorSeverity>16</ErrorNumber>
<ErrorMessage>XML Validation: XML instance must be a document.</ErrorMessage>
</Error>
(Refer to code example 18-1.) Which of the following statements could you use to determine if the @ErrorData variable contains the ErrorMessage element? Assume that the @ErrorData variable is declared with the xml data type and that it contains the XML data shown in the example.
IF @ErrorData.exist('/Error/ErrorMessage') = 1
IF @ErrorData.exist('ErrorMessage')
IF @ErrorData('/Error/ErrorMessage').exist = 1
IF @ErrorData('ErrorMessage').exist
2.
Which method would you use to split the nodes of the current xml data type into rows?
query
modify
value
nodes
3.
What can you call an element that contains other elements?
parent element
super element
sub element
child element
4.Which of the following INSERT statements inserts a row into a table named ErrorLog that consists of an identity column and a column that contains XML data?
INSERT INTO ErrorLog ('<Error>An error occurred</Error>');
INSERT INTO ErrorLog VALUES('<Error>An error occurred</Error>' xml);
UPDATE ErrorLog VALUES('<Error>An error occurred</Error>');
INSERT INTO ErrorLog VALUES('<Error>An error occurred</Error>');
a.IF @ErrorData.exist('/Error/ErrorMessage') = 1
b.IF @ErrorData.exist('ErrorMessage')
c.IF @ErrorData('/Error/ErrorMessage').exist = 1
d.IF @ErrorData('ErrorMessage').exist
Explanation / Answer
1)b
2)d
3 )a
4 )d
Note:This is given as an mcq option with exact values and also it deals with syntax so there is nothing to ellaborate