-- XPathFunctions_ID-IDREF_BookAuthor_XmlSchemaCollection_Script if (exists ( select * from sys.xml_schema_collections where (xml_schema_collections.[schema_id] = schema_id('dbo')) and (xml_schema_collections.name = 'BookAuthor') )) begin drop xml schema collection dbo.BookAuthor end go create xml schema collection dbo.BookAuthor as N' ' go