DROP XML SCHEMA COLLECTION (Transact-SQL)
SQL Server 2005
Deletes the whole XML schema collection and all of its components.
Transact-SQL Syntax Conventions
Dropping an XML schema collection is a transactional operation. This means when you drop an XML schema collection inside a transaction and later roll back the transaction, the XML schema collection is not dropped.
You cannot drop an XML schema collection when it is in use. This means that the collection being dropped cannot be any of the following:
-
Associated with any xml type parameter or column.
-
Specified in any table constraints.
-
Referenced in a schema-bound function or stored procedure. For example, the following function will lock the XML schema collection
MyCollectionbecause the function specifiesWITH SCHEMABINDING. If you remove it, there is no lock on the XML SCHEMA COLLECTION.
CREATE FUNCTION dbo.MyFunction() RETURNS int WITH SCHEMABINDING AS BEGIN ... DECLARE @x XML(MyCollection) ... END
To drop an XML SCHEMA COLLECTION requires DROP permission on the collection.
For more information, see Permissions on an XML Schema Collection.
Reference
CREATE XML SCHEMA COLLECTION (Transact-SQL)ALTER XML SCHEMA COLLECTION (Transact-SQL)
EVENTDATA (Transact-SQL)
Other Resources
xml Data TypeTyped vs. Untyped XML
Dropping an XML Schema Collection
Modifying an XML Schema Collection
Guidelines and Limitations in Using XML Schema Collections on the Server