adspace


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

do you know how to configure db2 side of the application? : Sql server database administration

1125


How raid can influence database performance?

1119


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1300


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

1048


How to remove duplicate rows from table except one?

1091


What is self contained sub query?

1141


Does view occupy space?

1022


How to convert numeric expression data types using the cast() function?

1151


How to enter binary string literals in ms sql server?

1246


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

2568


What are different types of constraints?

1003


What are the different subsets of sql?

1655


How do I create a trace in sql server?

1121


If any stored procedure is encrypted, then can we see its definition in activity monitor?

1073


What is standby servers? Explain types of standby servers.

1081