xml_schema_namespace (Transact-SQL)
Reconstructs all the schemas or a specific schema in the specified XML schema collection. This function returns an xml data type instance.
When you import XML schema components in the database by using CREATE XML SCHEMA COLLECTION or ALTER XML SCHEMA COLLECTION, aspects of the schema used for validation are preserved. Therefore, the reconstructed schema may not be lexically the same as the original schema document. Specifically, comments, white spaces, and annotations are lost; and implicit type information is made explicit. For example, <xs:element name="e1" /> becomes <xs:element name="e1" type="xs:anyType"/>. Also, namespace prefixes are not preserved.
If you specify a namespace parameter, the resulting schema document will contain definitions for all schema components in that namespace, even if they were added in different schema documents or DDL steps, or both.
You cannot use this function to construct XML schema documents from the sys.sys XML schema collection.
