+ Start a Discussion

Difference between database trigger(sql or oracle) and salesforce trigger

Hi Everyone,


     I am Sfdc newbee can anyone tell me the difference between general database trigger and salesforce triggers ???



 Thanks in Advance ,

 Response is highly appreciated.

Best Answer chosen by Admin (Salesforce Developers) 
Cory CowgillCory Cowgill

They are very similar. Database triggers and Apex Triggers both execute at the database layer, meaning any DML Statement (Insert, Update, Delete, Upsert, etc) causes the trigger to fire. They both have trigger contexts (before insert, after insert, etc). They are essentially the same for one difference.


The major difference is that Apex Triggers have what are called governor limits. Governor limits ensure that an Apex Trigger does not consume all the CPU resources since Force.com is a multi-tenant architecture. On a Oracle or SQL Server you can have triggers which can consume all resources and run in infinitte loops. Force.com prevents that with Governor Limits.