Create Queue SQL Server 2012
--
=============================================
-- CREATE QUEUES FOR SERVICE BROKER
--
=============================================
CREATE QUEUE <QUEUE-NAME, SYSNAME, TEST_QUEUE>
WITH
STATUS = ON,
RETENTION = OFF ,
ACTIVATION (
STATUS = ON,
PROCEDURE_NAME = <PROC-NAME, SYSNAME, TEST_PROCEDURE> ,
MAX_QUEUE_READERS = <MAXREADERS, INT, 1>,
EXECUTE AS <EXECUTE-OPTIONS,,SELF> ),
POISON_MESSAGE_HANDLING (STATUS = ON)
ON <FILEGROUP,,[DEFAULT]>
--
=============================================
-- CHECKING QUEUES
--
=============================================
SELECT * FROM SYS.SERVICE_QUEUE_USAGES