Forum Moderators: open
Is there a common reason it would choose a different execution plan for three transactions in a stored procedure than when they transactions are run individually?
(if more details are needed, let me know, I put them up but I'm not sure they are necessary)
Thanks,
arran, yes.
The insert portion of the stored procudure costs the same as running it as a transactin but the updates cost significantly more (1.04 vs .0365). For some reason the when these transactions are done from within stored procedure they use an index scan instead of index seek. Here's a basic run down...
When run as a transaction
Update <- Clustered Index Update <- Compute Scalar <- Compute Scalar <- Table Spool <- Top <- Index Seek
When run from within the stored procedure
Update <- Clustered Index Update <- Compute Scalar <- Compute Scalar <- Compute Scalar <- Top <- Nested Loops/InnerJoin <- (two forks - Index Scan and Clustered Index Seek)
I understand if this is a bit too specific to be solved on a message board. Thanks for any help you may be able to provide.