xp_findnextmsg (Transact-SQL)
Accepts a message ID for input and returns the message ID for output. xp_findnextmsg is used with sp_processmail in order to process mail in the Microsoft SQL Server inbox.
Note: |
|---|
| This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. |
Transact-SQL Syntax Conventions
- [ @type=] type
-
Is the input message type based on the MAPI definition:
IP[M|C].Vendorname.subclassIf type is NULL, message types that start with
IPMappear in the inbox of the mail client and are found or read by xp_findnextmsg. Message types that start withIPCdo not appear in the inbox of the mail client and must be found or read by setting the type parameter. The default is NULL. SQL Mail supports message types ofIPMandIPC.
- [ @unread_only=] 'unread_value'
-
Is whether only unread (N'TRUE') messages are considered. The default is N'FALSE', which means all messages are considered. unread_value is of type nvarchar(5).
- [ @msg_id=] 'message_id'
-
Is an input and output parameter that specifies the string of the message on input and the string of the next message on output. If message_id for the input is NULL, then by default, the output @msg_id will be the ID for the most recently delivered message in the Inbox. message_id is varchar(255), with a default of NULL.
- OUTPUT
-
When specified, message_id is placed in the output parameter. When not specified, message_id is returned as a single-column, single-row result set.
Note: