Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 sysmail_mailattachments (Transact-S...
Community Content
In this section
Statistics Annotations (0)
Other versions are also available for the following:
SQL Server 2008 Books Online (October 2008)
sysmail_mailattachments (Transact-SQL)

Contains one row for each attachment submitted to Database Mail. Use this view when you want information about Database Mail attachments. To review all e-mails processed by Database Mail use sysmail_allitems (Transact-SQL).

Column name Data type Description

attachment_id

int

Identifier of the attachment.

mailitem_id

int

Identifier of the mail item that contained the attachment.

filename

nvarchar(520)

The file name of the attachment. When attach_query_result is 1 and query_attachment_filename is NULL, Database Mail creates an arbitrary filename.

filesize

int

The size of the attachment in bytes.

attachment

varbinary(max)

The content of the attachment.

last_mod_date

datetime

The date and time of the last modification of the row.

last_mod_user

sysname

The user who last modified the row.

When troubleshooting Database Mail, use this view to see the properties of the attachments.

Attachments stored in the system tables can cause the msdb database to grow. Use sysmail_delete_mailitems_sp to delete mail items and their associated attachments. For more information, see How to: Create a SQL Server Agent Job to Archive Database Mail Messages and Event Logs.

Granted to the sysadmin fixed server role and the DatabaseMailUserRole database role. When executed by a member of the sysadmin fixed server role, this view shows all attachments. All other users only see the attachments for messages that they submitted.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker