I have schema collection association for an XML column. I want to add a child element to an existing parent in the schema collection.
I am trying to achieve this without dropping the schema association because the table having that column contains data and it restricts while dropping the association.
The schema looks like this
create xml schema collection dbo.Book
as
N'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Books">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="AuthorFirstName" maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>';
go
Now I want to add one more child element inside the parent element(Books), like this
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Books">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="AuthorFirstName" maxOccurs="unbounded" minOccurs="0"/>
<xsd:element type="xsd:string" name="AuthorLastName" maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Any solutions to alter the XML schema collection without dropping it?