SQL Server Interview Question - What is trigger and different types of Triggers?
Trigger is a SQL server code, which execute when a kind of action on a table occurs like insert, update and delete. It is a database object which is bound to a table and execute automatically. Triggers are basically of two type’s namely " After Triggers " and " Instead of Triggers ". 1.After Triggers:- this trigger occurs after when an insert, update and delete operation has been performed on a table. “After Triggers” are further divided into three types AFTER INSERT Trigger. AFTER UPDATE Trigger. AFTER DELETE Trigger. Let us consider that we have the following two tables. Create “Customer” table with the following field as you see in the below table. Cust_ID Cust_Code Cust_Name Cust_Salary 1 A-31 Moosa 4500 2 A-09 Feroz 5000 3 A-16 Wasim 4000 Create “Customer_Audit” table with the following field as you see in the below table. Cust_ID Cust_Name Operation_Performed Date_Time...