I am trying to set up a stored procedure to retrieve to 20 messages from a queue into a table to implement a batched process. I have the following code in a stored procedure.
RECEIVE top (20) -- get batched so that we can process same listid once
message_body, -- the message contents
conversation_handle -- the identifier of the dialog this message was received on
), TIMEOUT 3000 -- if the queue is empty for three second, give UPDATE and go away
However, the stored procedure is only retrieving 1 message at a time from the queue. Did I miss some other setting