我收到以下错误。你能帮我解决一下吗
触发
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
答案 0 :(得分:0)
在您的错误中,它表示" 对应于您的MySQL服务器版本"所以我猜你使用MySQL作为你的数据库。你有几个错误:
sp_send_dbmail
是SQL Server函数CREATE TRIGGER
句子中的顺序是错误的。 它应该类似于:
CREATE TRIGGER notifyMe
AFTER UPDATE
ON sb_clients
[Your trigger code]