Must declare the scalar variable

ice_breaker

Registered User.
Local time
Today, 23:06
Joined
Nov 10, 2008
Messages
20
I wanna create a service broker, but in the process of creating the dialog, it shows errors as Must declare the scalar variable "@dialog_handle". The last code shows error. Please advise

Below is the code:

Alter Database ServiceBroker Set Enable_Broker;

Create Message Type Hello_Service_Broker
Validation = Well_Formed_XML

Create Contract SendContract
( Hello_Service_Broker Sent By Initiator)

Create Queue dbo.TargetQueue

Create Queue dbo.InitiatorQueue

Create Service InitiatorService ON QUeue dbo.InitiatorQueue

Create Service TargetService ON QUeue dbo.TargetQueue
( SendContract)
-- Begin Transaction
Begin Transaction

-- Create Msg
Declare @message XML;
Set @message=N '<message>Hello World</message>'

-- Declare a conversation to hold a conversation handle
Declare @conversationHandle UniqueIdentifier;

-- Declare a dialog
Declare @dialog_handle UniqueIdentifier;

-- Begin the dialog
Begin Dialog Conversation
@dialog_handle From Service InitiatorService
To Service 'Target Service'
On Contract Hello_Service_Broker;
 

Users who are viewing this thread

Back
Top Bottom