Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,All i hope you are fine i need some help regarding how to check trigger is fired or not in C#.
Posted
Comments
PIEBALDconsult 23-May-15 20:07pm    
My first thought is to check how many records were affected, but we'll need more detailed information to give a proper response.
Dave Kreskowiak 23-May-15 20:10pm    
You can't really, unless you look for the specific effects the trigger has on the database.
Sergey Alexandrovich Kryukov 23-May-15 21:48pm    
You don't really need "to check" anything. Probably you can get more help if you explain your ultimate goals.
—SA

1 solution

I don't think its possible. Triggers automatically initiate during update, insert or delete. But, you can validate the availability status of trigger as below:

SQL
select * from dbo.sysobjects
where name = 'MyTrigger' and OBJECTPROPERTY(id, 'IsTrigger')
 
Share this answer
 

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