Advertisement
Guest User

SendMsgServiceBroker

a guest
Nov 4th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. CREATE PROCEDURE SendMsgServiceBroker
  2. @ProcedureName VARCHAR(1000),
  3. @inserted XML = NULL,
  4. @deleted XML = NULL
  5. AS
  6. SET NOCOUNT ON;
  7.  
  8. DECLARE @msg XML
  9.  
  10. -- build the XML message
  11. SET @msg = (SELECT
  12. ProcedureName = @ProcedureName,
  13. inserted = @inserted,
  14. deleted = @deleted
  15. FOR XML PATH('Request'))
  16.  
  17. DECLARE @DlgId UNIQUEIDENTIFIER
  18.  
  19. BEGIN DIALOG @DlgId
  20. FROM SERVICE [//SMS_SB/InitiatorService]
  21. TO SERVICE '//SMS_SB/TargetService'
  22. ON CONTRACT [//SMS_SB/Contract]
  23. WITH ENCRYPTION = OFF;
  24.  
  25. -- send the message
  26. SEND ON CONVERSATION @DlgId
  27. MESSAGE TYPE [//SMS_SB/Request] (@msg);
  28.  
  29.  
  30. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement