January 28, 2009 at 6:59 am
I have come across a potential issue. A stored proc called from inside a cursor in an update trigger. To help this along the table is the subscriber of a central table in the production database.
Is it posible to calculate the volume / frequency of updates to the base table before it all starts falling apart?
January 28, 2009 at 7:19 am
Put down the cursor and back away from the trigger...
To answer your question, I'm not sure. When I first read the headline it was like watching a train wreck, I had to read more.
It may help to see the code, but I really thing this sounds like something that needs to be fixed before it breaks, it is just waiting to happen. Also, a little more detail behind the process would probably also help, you said this table was a subscriber to another table, so that indicates replication.
January 28, 2009 at 7:42 am
That is scary.
Really, I think you should try to figure out some other logic to what ever you are doing. Using a Cursor is a cardinal sin. On top of that it is inside a trigger. That makes it very scary. Sorry
-Roy
January 28, 2009 at 7:45 am
Thanks Lynn
I don't think I explained my needs very well.
My problem is not in fixing this ( I am actually looking forward to working with a tally table and Jeff Moden's article),
it is being granted the time to work on it.
Really I'm looking for some math that demonstrats that a trigger is going to do harm.
At the moment it looks like I am the only person in the company that sees this as an issue.
Oh yes, you are right about replication.
January 28, 2009 at 3:09 pm
ian McCann (1/28/2009)
Thanks LynnI don't think I explained my needs very well.
My problem is not in fixing this ( I am actually looking forward to working with a tally table and Jeff Moden's article),
it is being granted the time to work on it.
Really I'm looking for some math that demonstrats that a trigger is going to do harm.
At the moment it looks like I am the only person in the company that sees this as an issue.
Oh yes, you are right about replication.
We can certainly do some "math" to show why it might (usually is) bad. But, in order to do that, we need to see the code for the trigger and the code for the called proc.
If you just want some simple "math" to demonstrate why a cursor is worse than set based, I think we can probably come up with that.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 28, 2009 at 3:47 pm
Unless there are almost no changes this is a recipe for disaster!
* Noel
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply