How to check if a Trigger exists in Sql Server  

  RSS

Mitesh
(@mitesh)
New Member Registered
Joined: 11 months ago
Posts: 1
20/07/2018 10:52 am  

How to check if a Trigger exists in Sql Server


ReplyQuote
John murrey
(@john-murrey)
New Member Registered
Joined: 11 months ago
Posts: 2
20/07/2018 11:09 am  

Hi Mitesh,

You can easily check if a Trigger exists in Sql Server or not by this way :-

SELECT * FROM sys.triggers

        it will return a table that contains a row for each object that is a trigger, with a type of TR or TA.

SELECT Count(*) FROM sys.triggers where name = ‘YourTriggerName’

       it can be used if one need to look if a particular trigger exists or not. The above line of code will return a 0 if the specified trigger is not present, otherwise 1 will be returned.


ReplyQuote
Share:
  
Working

Please Login or Register