Home SQL Server Commands
 

ALTER XML SCHEMA COLLECTION

Add new schema components to an existing XML schema collection.

Syntax
      ALTER XML SCHEMA COLLECTION [relational_schema.]sql_identifier ADD 'Schema Component'

Key
   relational_schema  The relational schema name.

   sql_identifier     SQL identifier for the XML schema collection.

   Schema Component   The schema component to insert.

This command can be used to add an entirely new XML schema, (namespace not currently in the XML schema collection), or add a new component to an existing namespace in the collection.

Example

ALTER XML SCHEMA COLLECTION MyCollection ADD '
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://MySchema/my_xml_schema">
<element name="anotherElement" type="byte"/>
</schema>'

"I have spread my dreams under your feet;
Tread softly because you tread on my dreams" ~ William Butler Yeats

Related commands:

sys.xml_schema_collections
sys.xml_schema_namespaces
CREATE XML SCHEMA COLLECTION
DROP XML SCHEMA COLLECTION



Back to the Top

Simon Sheppard
SS64.com