How to write a MySQL before insert trigger to insert data in a table?

Hi,
I need to create a trigger for when I insert data in the first table to be able to insert in the second some data related to the first one.

CREATE TRIGGER test1
ON Telegramas
BEFORE INSERT 
AS
BEGIN
    INSERT INTO Dispositivos SET Dispositivos.GrupoOrigen = Telegramas.GrupoOrigen;
  END;

I created that but there is a syntax error that I can not see. need help? or another way to make this relationship easier?

thanks

Hi hariprasadseo5 welcome to the forum

Does the “syntax error” message not provide any further clues (even if they are cryptic to you) as to what and where the error is?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.