Hi,
I wanted to use SQL trigger on my tables, but SQL connector doesn't allow it:
Insert and update to a table won't work if you defined a SQL server-side trigger on the table.
From : https://learn.microsoft.com/en-us/connectors/sql/#general-known-issues-and-limitations
Each of my table contain 3 triggers: insert, update and delete.
Now, I need to find an alternative to do what I want since, like I said, Power Apps doesn't allow table with triggers.
I saw that Power Automate contain an trigger called "When an item is modified (V2)", but it doesn't do what I need since I need to have the data before I updated the record and after I updated the record.
Here is an example of a trigger I need in SQL:
CREATE TRIGGER table_update_overloading
ON my_table
AFTER UPDATE
AS
BEGIN
INSERT INTO table_xxx (yyy)
SELECT yyy FROM deleted
INSERT INTO table_xxx (yyy)
SELECT yyy FROM inserted
END;
GO
But, for some other tables, my triggers are much more complicated, so I don't see how I can do an patch since it would be way too slow:
CREATE TRIGGER my_table
ON my_table
AFTER UPDATE
AS
BEGIN
INSERT INTO table_xxx (yyy)
SELECT yyy_1
FROM another_table_1
WHERE id in (
SELECT yyy_2
FROM another_table_2
WHERE id in (
SELECT another_table_3 FROM deleted
)
)
INSERT INTO table_xxx (yyy)
SELECT yyy_1
FROM another_table_1
WHERE idTacheTravail in (
SELECT yyy_2
FROM another_table_2
WHERE id in (
SELECT another_table_3 FROM inserted
)
)
END;
GO
Is there an alternative ?