DROP CONTRACT (Transact-SQL)
Applies to: SQL Server (all supported versions)
Drops an existing contract from a database.
DROP CONTRACT contract_name [ ; ]
To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
The name of the contract to drop. Server, database, and schema names cannot be specified.
You cannot drop a contract if any services or conversation priorities refer to the contract.
When you drop a contract, Service Broker ends any existing conversations that use the contract with an error.
Permission for dropping a contract defaults to the owner of the contract, members of the db_ddladmin or db_owner fixed database roles, and members of the sysadmin fixed server role.
The following example removes the contract
//Adventure-Works.com/Expenses/ExpenseSubmission from the database.
DROP CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission] ;
Submit and view feedback for