mullvad on Nostr: Anyone familiar with triggers? I get a syntax error and im not sure what is wrong on ...
Anyone familiar with triggers? I get a syntax error and im not sure what is wrong on line 2. First time creating a trigger.
CREATE TRIGGER trig_check_geometry
ON pipeline.tek_water_area AFTER INSERT, UPDATE
AS
BEGIN
IF EXISTS (
SELECT *
FROM inserted
WHERE geometry_column.STIsValid() = 0
)
BEGIN
RAISERROR ('Invalid geometry detected. Please insert valid geometries only.', 16, 1);
ROLLBACK TRANSACTION;
END
END
CREATE TRIGGER trig_check_geometry
ON pipeline.tek_water_area AFTER INSERT, UPDATE
AS
BEGIN
IF EXISTS (
SELECT *
FROM inserted
WHERE geometry_column.STIsValid() = 0
)
BEGIN
RAISERROR ('Invalid geometry detected. Please insert valid geometries only.', 16, 1);
ROLLBACK TRANSACTION;
END
END