sysmail_help_queue_sp (Transact-SQL)
There are two queues in Database Mail: the mail queue and status queue. The mail queue stores mail items that are waiting to be sent. The status queue stores the status of items that have already been sent. This stored procedure allows viewing the state of the mail or status queues. If the parameter @queue_type is not specified, the stored procedure returns one row for each of the queues.
Column name | Data type | Description |
|---|---|---|
queue_type | nvarchar(6) | The type of queue. Possible values are mail and status. |
length | int | The number of mail items in the specified queue. |
state | nvarchar(64) | The state of the monitor. Possible values are INACTIVE (queue is inactive), NOTIFIED (queue has been notified receipt to occur), and RECEIVES_OCCURRING (queue is receiving). |
last_empty_rowset_time | DATETIME | The date and time that the queue was last empty. In military time format and GMT time zone. |
last_activated_time | DATETIME | The date and time the queue was last activated. In military time format and GMT time zone. |
The following example returns both the mail and status queues.
EXECUTE msdb.dbo.sysmail_help_queue_sp ; GO
This is a sample result set has been edited for length.
queue_type length state last_empty_rowset_time last_activated_time ---------- -------- ------------------ ----------------------- ----------------------- mail 0 RECEIVES_OCCURRING 2005-10-07 21:14:47.010 2005-10-10 20:52:51.517 status 0 INACTIVE 2005-10-07 21:04:47.003 2005-10-10 21:04:47.003 (2 row(s) affected)

