December 27, 2011 at 8:56 am
Hi,
I have a value stored in the @mqr variable that I would set as MAX_QUEUE_READERS, but this query gives error:
ALTER QUEUE Test_Queue WITH STATUS=ON,
ACTIVATION (STATUS=ON, PROCEDURE_NAME = usp_Test, MAX_QUEUE_READERS = @mqr, EXECUTE AS SELF);
What is the correct syntax ? Thanks
December 30, 2011 at 8:08 am
I'm betting max_queue_readers needs to be a constant. I've run across a couple of cases that T-SQL doesn't like variables in certain statements. Try a constant instead of a variable?
December 30, 2011 at 8:49 am
Thank you for your response. I've solved in this mode:
EXEC ('ALTER QUEUE Test_Queue WITH STATUS=ON, ACTIVATION (STATUS=ON, PROCEDURE_NAME=usp_Test, MAX_QUEUE_READERS = '
+ @mqr
+ N', EXECUTE AS SELF);')
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply