Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

DROP CONTRACT (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Drops an existing contract from a database.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

DROP CONTRACT contract_name 
[ ; ]

contract_name

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] ;

Community Additions

ADD
Show:
© 2015 Microsoft