DROP XML SCHEMA COLLECTION (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![no](media/no.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

Deletes the whole XML schema collection and all of its components.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
DROP XML SCHEMA COLLECTION [ relational_schema. ]sql_identifier  

Arguments

relational_schema
Identifies the relational schema name. If not specified, the default relational schema is assumed.

sql_identifier
Is the name of the XML schema collection to drop.

Remarks

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:

Permissions

To drop an XML SCHEMA COLLECTION requires DROP permission on the collection.

Examples

The following example shows removing an XML schema collection.

DROP XML SCHEMA COLLECTION ManuInstructionsSchemaCollection;  
GO  

See Also

CREATE XML SCHEMA COLLECTION (Transact-SQL)
ALTER XML SCHEMA COLLECTION (Transact-SQL)
EVENTDATA (Transact-SQL)
Compare Typed XML to Untyped XML
Requirements and Limitations for XML Schema Collections on the Server