There is a trigger defined for INSERT operations on a
table, in an OLTP system. The trigger is written to
instantiate a COM object and pass the newly insterted rows
to it for some custom processing. What do you think of this
implementation? Can this be implemented better?

Answer Posted / swapna

Instantiating COM objects is a time consuming process and
since you are doing it from within a trigger, it slows down
the data insertion process. Same is the case with sending
emails from triggers.

This scenario can be better implemented by logging all the
necessary data into a separate table, and have a job which
periodically checks this table and does the needful.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?

693


After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas

657


How can we delete Duplicate row in table?

714


Does any body please help me what question's have asked for SSRS in the interview?

1757


Which is faster statement or preparedstatement?

618






Is BCNF better than 2NF & 3NF? Why?

707


List out the differences between global and local temp tables in sql server?

661


What is the difference between char and varchar2 datatype in sql?

635


What is the difference between row_number and dense_rank?

511


How to add additional conditions in SQL?

671


What is sql server replication? : sql server replication

617


How to recompile stored procedure at run time?

642


How to get the definition of a user defined function back?

664


What guidelines should be followed to help minimize deadlocks?

594


What are the two modes of authentication in sql server?

606