我没有得到这个存储过程,你能告诉它“master..xp_sendmail”在哪里吗
当任何插入发生在像“Emp”这样的特定表中时,我会发送邮件
最佳答案
根据 Microsoft 的说法,您不应再使用 xp_sendmail。改用这个:
http://msdn.microsoft.com/en-us/library/ms175887(v=SQL.90).aspx
至于发送电子邮件的过程......我会解耦插入和发送电子邮件。您可以有一个 SQL Server 作业来轮询表中的新条目并在需要时发送电子邮件。该作业可以安排为每 5 分钟运行一次。
来自 MS 的注释:
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. To send mail from SQL Server, use Database Mail.
编辑:合并了 adolf garlic 评论中的有用链接
关于sql - SQL Server 2005发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3573733/