1. | What does it mean for an xml data type column to be "typed"? |
|
2. | What parts make up an XQuery expression? |
|
3. | What purpose does the sql:variable function provide? |
|
4. | When you are returning data as XML using the FOR XML clause, what mode enables you to easily return data in a hierarchical format? |
|
Answers
1. | Typed XML columns are associated with one or more schema definitions. The schema is used to validate the XML document contained within the column and contains information about what data can reside within nodes and attributes. |
2. | An XQuery expression is composed of the prolog and the body. The prolog is the first part and is used to declare namespaces that refer to the location of the schema definition file. |
3. | The sql:variable function can be used to pass data to an XQuery expression. This enables you to pass parameters to your XQuery expression and makes the query more dynamic. |
4. | AUTO mode is the easiest way to return data in a hierarchical format. However, AUTO mode gives you the least control over how the data is shaped. You can use the PATH or EXPLICIT modes to control how the XML is shaped. |