Trigger Definition |
---|
CREATE trigger TR_CONSTITUENT_UPDATE_ISORGANIZATION on dbo.CONSTITUENT after update not for replication as begin if update(ISORGANIZATION) begin update dbo.CONSTITUENT set ISORGANIZATION=1 from inserted where inserted.ID=CONSTITUENT.ID and CONSTITUENT.ISORGANIZATION=0 and exists (select ID from dbo.ORGANIZATIONDATA where ID=CONSTITUENT.ID) if @@rowcount>0 raiserror('Constituents with organization data cannot be set as individuals.', 13, 1) end end |