RFEULINGatRITE
MIS
Hello,
We have written an update trigger that we are having problems with.
This trigger was designed to check and see if a price change in an item table occurred and if so, put an entry into another table.
Problem is, another part of the program can update lots of prices and it does it with a single update statement so for the trigger to work we have to use a cursor and then loop through it to make an entry for each update.
Without the trigger, the query takes about 1 second for 1000 item price changes, with the trigger it takes about 4 minutes. Another HUGE problem is that it totally bogs SQL down, other programs connected to that database freeze. It's not that it uses a lot of processor power to perform the trigger, from the performance monitor its doing tons of disk transfers per second - it seems as though all this has to be done on the hard drive and not in memory for some reason...?
Am I making some common error? Is there a way to shift this burden onto ram so that the query can run faster?
Thanks for the help!!
We have written an update trigger that we are having problems with.
This trigger was designed to check and see if a price change in an item table occurred and if so, put an entry into another table.
Problem is, another part of the program can update lots of prices and it does it with a single update statement so for the trigger to work we have to use a cursor and then loop through it to make an entry for each update.
Without the trigger, the query takes about 1 second for 1000 item price changes, with the trigger it takes about 4 minutes. Another HUGE problem is that it totally bogs SQL down, other programs connected to that database freeze. It's not that it uses a lot of processor power to perform the trigger, from the performance monitor its doing tons of disk transfers per second - it seems as though all this has to be done on the hard drive and not in memory for some reason...?
Am I making some common error? Is there a way to shift this burden onto ram so that the query can run faster?
Thanks for the help!!