1. Describe XML Schema?

A schema is a blueprint of an XML document that defines the elements, data types and nesting structure of the page.
An XML schema is a road map for the XML document similar to a Document Type Definition (DTD). Created by the World Wide Web Consortium (W3C), schemas describe the elements and map out the presentation and nesting of XML documents.
Essentially, the schema enables all applications to understand the flow of the page and validate the elements.

2. Limitations of the XML Schema collection?

★ SQL Server limits identifiers of schema components to a maximum length of 1000 Unicode characters. Also, surrogate character pairs within identifiers are not supported.
★ SQL Server does not support restrictions from union types.
★ The values for minOccurs and maxOccurs attributes must fit into 4-byte integers. Schemas that do not conform are rejected by the server.
★ xsi:schemaLocation and xsi:noNamespaceSchemaLocation
★ SQL Server ignores these attributes if they are present in the XML instance data inserted into a column or variable of xml data type.
★ SQL Server rejects schemas that have an particle without children, unless the particle is defined with a minOccurs attribute value of zero.
★ Currently, SQL Server does not support . XML schemas that include this element are rejected by the server.
★ Currently, SQL Server does not support <xsd:key>, <xsd:keyref>, and <xsd:unique> constraints for enforcing uniqueness or establishing keys and key references. XML schemas that contain these elements cannot be registered.
★ The length, minLength, and maxLength facets are stored as a long type. This type is a 32-bit type. Therefore, the range of acceptable values for these values is 2^31.
★ SQL Server does not support the NOTATION type.
★ SQL Server does not support types derived from xs:QName that use an XML Schema restriction element and the union types with xs:QName as a member element.
★ Members cannot be added to an existing substitution group in an XML schema collection.
★ The canonical representation of a value cannot violate the pattern restriction for its type.
★ SQL Server does not support XML schemas with types that have pattern facets or enumerations that violate those facets.
★ In working with large XML schema collections, an out-of-memory condition might occur.
★ SQL Server rejects schemas in which the block or final attribute has repeated values such as "restriction restriction" and "extension extension". .

3. Why use an XML Schema?

Schemas allow all applications to understand the rules and content of the page.
A schema is the blueprint of an XML document. Since XML works to move data, it is essential that the sender and the receiver of this data both understand the content.

4. Can we write a DTD instead of Schema?

You could write a DTD for an XML page and accomplish some of the same goals. However, because a schema is written in XML, there is no new syntax or rules to understand. If you can write a page in XML, you can write an XML schema.

5. Define XML support SQL server extends?

SQL server can return XML document using FOR XML clause. XML documents can be added to SQL Server database and you can use the OPENXML clause to display the data from the document as a relational result set. SQL Server 2000 supports XPath queries.

6. Which 3 major elements SQL Server (server-side) supports?

1) Creation of XML fragments: This is done from the relational data using FOR XML to the select query.
2) Ability to shred xml data to be stored in the database.
3) Finally, storing the xml data.

7. Client-side XML support in SQL Server is in the form of SQLXML. Described in terms?

XML Views:
Providing bidirectional mapping between XML schema's and relational tables.
Creation of XML Templates:
Allows creation of dynamic sections in XML.

8. Define XML schema permission "| Database_user_mapped_to_certificate"?

Specifies a database user mapped to a certificate.

9. Define XML schema permission "| Database_user_mapped_to_Windows_Group"?

Specifies a database user mapped to a Windows group.

10. Define XML schema permission "| Database_user_with_no_login"?

Specifies a database user with no corresponding server-level principal.

Download Interview PDF