Dropping XML Schema

Last modified: October 23, 2019

Dropping XML Schemas provides some peculiarities. There can be objects depending on the given XML schema, so be careful while deleting XML schema, for these objects will become inaccessible for editing and deleting operations if the source XML schema is dropped but the dependent objects are not.

Four options for XML schema deleting exist:

  • DELETE_RESTRICT: Schema deletion fails if there are any tables or schemas that depend on this schema.
  • DELETE_INVALIDATE:Schema deletion does not fail if there are any dependencies. Instead, it simply invalidates all dependent objects.
  • DELETE_CASCADE: Schema deletion will also drop all default SQL types and default tables. However the deletion fails if there are any stored instances conforming to this schema.
  • DELETE_CASCADE_FORCE: Similar to CASCADE except that it does not check for any stored instances conforming to this schema. Also it ignores any errors.

To drop an XML Schema, expand the XML Schemas folder in the Database Explorer. Right-click a required object, and click Delete on the shortcut menu. The dialogue asking if the object has to be dropped appears. Select Yes to delete an XML Schema.