Msg 187, Level 15, State 1, Line 6
The valid range for MAX_QUEUE_READERS is 0 to 32767.
This error message appears when you specify an invalid number for the MAX_QUEUE_READER option during a CREATE/ALTER QUEUE statement.
The SQL statement cannot be parsed and further execution is stopped.
Error of the Severity level 15 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. The value for the MAX_QUEUE_READER option must be valid and within the specified range.
This error message was introduced with SQL Server 2005.
IF OBJECT_ID(‘MyQueue’) > 0
DROP QUEUE MyQueue;
CREATE QUEUE MyQueue
PROCEDURE_NAME = MyQueue_Proc,
MAX_QUEUE_READERS = 33000) ;
In the above example we try to use a value of 33000 for the MAX_QUEUE_READER option. This raises the error.