March 11, 2009 at 3:42 pm
I'm fairly confident.
@AbsTab is created as a table variable just above the INSERT.
'absence' is a hard table, if we were not hitting the proper table here due to ownership we would be seeing a lot more problems then duplicate rows.
@CloseAbs is a table variable created above this query and has a PK on abs_id,org_id...but we reference this table via a UNCORRELATED SUBQUERRY with a 'NOT IN'.
Just a thought...the 'NOT IN' creates a 'Left Anti Semi Join' in the query plan. If I have duplicate abs_id's in this table could this cause the problem? Since this is a 'NOT IN', I would not expect it to create duplicates.
March 11, 2009 at 3:46 pm
If I have duplicate abs_id's in this table could this cause the problem?
I don't think so. Can you post the full code?
bc
[font="Arial Narrow"]bc[/font]
March 11, 2009 at 4:07 pm
I have uploaded my sample code.
disclaimer...i take no credit for this code, I simply have the joy of debugging it
This is a snippet of the original procedure, but I can duplicate the issue with this sample.
Note: this works most of the time without problem, and only receives errors during peak load.
March 12, 2009 at 8:32 am
i'm sorry, i can't see anything that would allow dupes into the query and cause the PK violation. bc
[font="Arial Narrow"]bc[/font]
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy