SQL Server Database Administrator Question:
Download Questions PDF

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 inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?

SQL Server DB Administrator Interview Question
SQL Server DB Administrator Interview Question

Answer:

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.

Download SQL Server DB Administrator Interview Questions And Answers PDF

Previous QuestionNext Question
What is a join and explain different types of joins?What are constraints? Explain different types of constraints?