Existence logic needed for triggers
When a new trigger is created, the script tests for existence first. So if the trigger does not exist, it will not create it. It should not test for existence as it will never create the trigger. It's unnecessary to check the object's existence if the product is using CREATE OR ALTER trigger.
-
Support Team commented
Hi,
Thank you for reaching out to us!
Kindly be informed that in particular, in Generate Script for the database, there is an option 'Check for object existence'. It will add this check before creating the trigger:
IF OBJECT_ID(N'dbo.trigger1', 'TR') IS NULL ... CREATE...
Could you please clarify, what functionality you mean? Where should be added the check?
Best regards,
Devart Support Team