2011년 6월 13일 월요일 오후 7:58For the following query, you want to generate inline XML Schema Definition (XSD) schema using a FOR XML query:
FROM HumanResources.Department d
WHERE d.DepartmentID IN ( 7, 8 )
FOR XML raw,
What changes should you make to the Transact-SQL statement?
1.Add the keyword XMLDATA at the end
2.Add the keyword ELEMENTS.
3.Add the keyword XMLSCHEMA at the end
4.Use the keyword XMLSCHEMA, ELEMENTS.
According to BOL, to generate inline XML Schema Definition (XSD) schema using a FOR XML query the keyword SMLSCHEMA should be used. according to this option 3 is correct. but the MCTS training says option 1.
can anyone tell me the correct answer?
2011년 6월 13일 월요일 오후 8:04중재자
Returns inline XDR schema, but does not add the root element to the result. If XMLDATA is specified, XDR schema is appended to the document.
- XMLSCHEMA [ ('TargetNameSpaceURI') ]
Returns inline XSD schema. You can optionally specify a target namespace URI when you specify this directive, which returns the specified namespace in the schema. For more information, see Inline XSD Schema Generation.
So, answer 3 can be considered correct.
For every expert, there is an equal and opposite expert. - Becker's Law
2012년 8월 20일 월요일 오후 9:42That one was considered the answer??!! Please try again. The question specifically asks for an XSD schema. The XMLDATA option produces an XDR schema. Two different animals. The test answer was in error, and to compound the problem you've got an expert on here justifying it, and to compound it further the moderator accepted this??? You cannot produce an XSD schema out of an XMLDATA keyword. Please correct this. The given answer is wrong. Answer number 3 is correct. Answer number 4 is plausible, but would be marked incorrect by because 3 is the better answer. Answer 1 is not correct. It cannot be considered correct from any viewpoint.
- 답변으로 표시됨 Naomi NMicrosoft Community Contributor, Moderator 2012년 8월 21일 화요일 오전 3:53