﻿USE [FabApprovalSystem]
GO
  /****** Object:  StoredProcedure [dbo].[Receive_Hello_Message]    Script Date: 11/21/2024 11:29:05 AM ******/
SET
  ANSI_NULLS ON
GO
SET
  QUOTED_IDENTIFIER ON
GO
  CREATE PROCEDURE [dbo].[Receive_Hello_Message] @text NVARCHAR(MAX) OUT AS BEGIN
SET
  NOCOUNT ON;

DECLARE @conversation_handle UNIQUEIDENTIFIER,
@message_body VARBINARY(MAX),
@message_type_name VARCHAR(256);

BEGIN TRANSACTION;

RECEIVE TOP (1) @conversation_handle = [conversation_handle],
@message_body = [message_body],
@message_type_name = [message_type_name]
FROM
  [dbo].[Hello_Message_Queue];

SET
  @text = CONVERT(NVARCHAR(MAX), @message_body);

PRINT '@text' + @text COMMIT TRANSACTION;

END
GO