SQL trigger disappears

I have a trigger on a sql server table. This trigger has disappeared. Is there something systematic that could lead to its removal?

There is no replication in this db.

+2


source to share


3 answers


In addition to what Randolph said, it is possible that some other developer or dba dropped the trigger because it interfered with what he or she wanted to do. Not everyone understands the consequences of having such stupid things happen. This would be a good example of the need for more formalized processes and restricting access to production if so.

Hopefully you have the trigger under source control and can easily recreate it.



You might also consider running DDL triggers so that you can prevent such things from happening in the future, or at least see who did them.

+1


source


Replaying the table may cause the trigger to go down. It is also possible to disable triggers. Could this be one of these options?



+4


source


2 options if disappeared

  • DROP / CREATE TABLE ...
  • DROP TRIGGER ...

Option if not working _

  • ALTER TABLE ... DISABLE TRIGGER ...

You can see if the table has been recreated using this. Of course it doesn't tell you who ...

SELECT create_date, modify_date FROM sys.objects WHERE name = 'MyTable'

      

For example, changing a table using SSMS GUI that went wrong may trigger a trigger. But there is no systematic process of accidentally dropping a trigger: it requires explicit action by someone.

+4


source







All Articles