Show TOC

Contracts (SQL Server)Locate this document in the navigation structure

Contracts define the message types used in a Service Broker conversation and also determine which side of the conversation can send messages of that type. Each conversation follows a contract. The initiating service specifies the contract for the conversation when the conversation begins. The target service specifies the contracts that the target service accepts conversations for. PowerDesigner models contracts as extended objects with a stereotype of <<Contract>>.

You create an identical contract in each database that participates in a conversation.

Creating a Contract

You can create a contract in any of the following ways:

  • Select Start of the navigation path Model Next navigation step Contracts End of the navigation path to access the List of Contracts, and click the Add a Row tool.

  • Right-click the model (or a package) in the Browser, and select Start of the navigation path New Next navigation step Contract End of the navigation path.

Contract Properties

You can modify an object's properties from its property sheet. To open a contract property sheet, double-click its Browser entry.

The following extended attributes are available on the Microsoft tab:

Name

Description

Authorization

Specifies a database user or role as the owner of the contract. If the current user is dbo or sa, this may be the name of any valid user or role. Otherwise, it must be the name of the current user, a user that the current user has IMPERSONATE permission for, or a role to which the current user belongs. By default, the contract belongs to the current user.

Scripting name: Owner

The MessageTypes tab lists the message types included in the contract via intermediary "message contract" objects. You can reuse an existing message contract or create a new one, using the tools on this tab.

Once you have added or created a message contract, double-click its entry to open its property sheet.