Creating Queues for Message Storage

Queues represent a layer of communication indirection between services, allowing them to send and receive messages independently of each other. A queue is a first-class database object, internally implemented as a table that has some unique behaviors.

Note

You can select values from any queue by using standard syntax, such as SELECT * FROM QueueName WITH (NOLOCK). This has no effect on the data in the queue, nor does it imply a message receive operation. It does, however, cause blocking on the internal queue table, so you should always use the NOLOCK hint. Data Manipulation Language (DML) statements on queues are not permitted.

The following is the syntax for creating a queue:

This syntax contains the following ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.