sqlenthu 89358 (8/24/2016)
sqlenthu 89358 (8/23/2016)
Hi,I was going through the concept of service broker but little confused. Can I make insert into table using following code:
DECLARE @SBDialog uniqueidentifier
DECLARE @Message NVARCHAR(128)
BEGIN DIALOG CONVERSATION @SBDialog
FROM SERVICE SBSendService
TO SERVICE 'SBReceiveService'
ON CONTRACT SBContract
WITH ENCRYPTION = OFF
-- Send messages on Dialog
SET @Message = N'Insert into table1(col1, col2), select col1, col2 from table2 where param = 1234';
SEND ON CONVERSATION @SBDialog
MESSAGE TYPE SBMessage (@Message)
Does this makes sense ?
I'm not sure if it would be any more parallel than simply running
Insert into table1(col1, col2), select col1, col2 from table2 where param = 1234
_____________
Code for TallyGenerator