Click here to Skip to main content
15,301,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can it create any problem if we disable the triggers associated with all databases and those triggers which are associated with tables in the database.

These triggers just restrict insert & delete operations.



Is there any general setting to disable all the triggers?
How to find out the list of triggers in database?
Posted

1 solution

I don't know full setup about your database, so i can't suggest about disable your triggers.
But i can help you to retrieve all triggers from your database.Try like this,
SQL
SELECT      Tables.Name TableName,
      Triggers.name TriggerName,
      Triggers.crdate TriggerCreatedDate,
      Comments.Text TriggerText
FROM      sysobjects Triggers
      Inner Join sysobjects Tables On Triggers.parent_obj = Tables.id
      Inner Join syscomments Comments On Triggers.id = Comments.id
WHERE      Triggers.xtype = 'TR'
      And Tables.xtype = 'U'
ORDER BY Tables.Name, Triggers.name

This is not my own code, referred from a link.
Reference: http://geekswithblogs.net/KingSurfers_Brain/archive/2008/05/30/find-all-triggers-and-their-text-with-t-sql.aspx[^]
   
Comments
jawad59 31-Mar-15 9:43am
   
i got trigger list through your code. There is only one trigger named- noinsertion. This trigger restrict insert operation in the table.

I do'nt know why its kept. Previously it was working fine. now, it gives this trigger error. if I disable it then works.

Also there is a common trigger for all database in server, which restricts delete & create database.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900