【问题标题】:Mail trigger error邮件触发错误
【发布时间】:2017-11-29 00:21:48
【问题描述】:

我收到以下错误。你能帮我解决它吗

触发器

CREATE TRIGGER notifyMe
ON sb_clients
AFTER UPDATE
AS
exec msdb.dbo.sp_send_dbmail
@profile_name = 'DB AutoMailer',
@recipients = 'mail@mail.com',
@body = 'The DB has changed',
@subject = 'DB Change'

错误

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON sb_clients
AFTER UPDATE
AS
exec msdb.dbo.sp_send_dbmail
@profile_name = '' at line 2

【问题讨论】:

标签: php sql triggers phpmyadmin


【解决方案1】:

在你的错误中它说“对应于你的 MySQL 服务器版本”所以我猜你正在使用 MySQL 作为你的数据库。你有几个错误:

  1. sp_send_dbmail 是 SQL Server 函数
  2. 根据 MySQL 参考,CREATE TRIGGER 语句中的顺序是错误的。

应该类似于:

CREATE TRIGGER notifyMe
AFTER UPDATE
ON sb_clients
[Your trigger code]

【讨论】:

    猜你喜欢
    • 2015-06-06
    • 1970-01-01
    • 2021-01-26
    • 1970-01-01
    • 2013-03-02
    • 1970-01-01
    • 2010-10-18
    • 2018-05-31
    • 2014-09-04
    相关资源
    最近更新 更多