将触发器从MS Sql迁移到MySql

时间:2015-03-31 09:38:57

标签: mysql sql-server triggers

我想将此MS sql触发器转换为MySql.My问题是:

  1. 不是为了复制:
  2. update()函数:
  3. 我不知道如何在MySql中添加相同的功能。以下是SQL Server Trigger code.please帮助。

    CREATE TRIGGER [trigger_name] 
     ON  [dbo].[table_name]
     for INSERT,UPDATE NOT FOR REPLICATION 
    AS BEGIN
    SET NOCOUNT ON;
    if update(column_name) 
    Begin
        Declare @SNo as varchar(50)
        Select @SNo = SNo From inserted
        IF Exists(Select * From inserted)  
        Begin
            exec procedure_name @SNo
        End
    End
    END
    

0 个答案:

没有答案