CREATE TRIGGER tr_person_setPersonID ON person AFTER INSERT AS DECLARE @newid int SET @newid = (select max(P.person_id) + 1 FROM person P JOIN inserted i ON i.study_id = P.study_id WHERE p.study_id = ...
A trigger is a special kind of stored procedure that automatically runs (fires) in response to specific database events such as INSERT, UPDATE, or DELETE on a table or view. Triggers can be used to ...
Abstract: Database integrity is an important research content of database security, triggers can enforce the more complex referential integrity, and this paper studies the approach of using DML ...