【问题标题】:How do I increase the maximum allowed attachment size for email sent using msdb.dbo.sp_send_dbmail in Microsoft SQL Server 2005/2008如何增加在 Microsoft SQL Server 2005/2008 中使用 msdb.dbo.sp_send_dbmail 发送的电子邮件的最大允许附件大小
【发布时间】:2009-06-15 18:37:12
【问题描述】:

症状: 使用 msdb.dbo.sp_send_dbmail 发送附件会导致以下错误:

文件附件或查询结果大小超过允许值 1000000 字节

如何提高该值?

【问题讨论】:

    标签: sql-server sql-server-2005 sql-server-2008


    【解决方案1】:

    在 SQL Server Management Studio 的对象资源管理器框架中,展开“管理”文件夹。打开数据库邮件配置向导。

    单击下一步-> 选择“查看更改系统参数”的单选按钮,然后单击下一步。

    现在更改最大文件大小(字节)属性并单击下一步,然后单击完成以保存更改。

    请参阅Database Mail Configuration Wizard at MSDN 了解更多信息。

    【讨论】:

      【解决方案2】:

      要使用 T-SQL,您可以使用 Database Mail system stored procedures 之一,它用于更改数据库邮件的配置设置 - sysmail_configure_sp

      MaxFileSize 参数用于指定附件的最大大小(以字节为单位)。因此,您可以使用以下代码行将此值更改为 1000 万字节:

      EXECUTE msdb.dbo.sysmail_configure_sp 'MaxFileSize', '10000000';
      

      【讨论】:

        【解决方案3】:
        Open Database Mail Configuration Wizard.
        Go to the “Select Configuration Task” window; Select the last option to the bottom “View or change systems parameters” and click Next.
        “Configure System Parameters” window pops up, modify the “Maximum File Size(Bytes)” Parameter to your need. 10000000 (~10MB) did the trick for us.
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-06-29
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-07-01
          • 1970-01-01
          • 2014-07-19
          • 2011-01-02
          相关资源
          最近更新 更多