Please help me, I'm desperate.
I have an old SQL2000 (SP4) - and no, I can't upgrade it, is in my customer server - on which I have a very, very strange issue which started on 01/01/2013. Until then, this problem never appeared.
I have an data export stored procedure, which fill a temporary table from a quite complicated select (multiple subqueries, with data cast, sums and so on) and export the final content in another table in a specific format. If I execute this s/p, either from calling application code, or from Query Analyzer (exec ...), it take very much time to execute (1.5 - 2 hours). If I check the status with sp_who2 I see that the process appears to be blocked by itself in the "INSERT INTO" temporary table. But if I directly execute the s/p code from Query Analyzer, the result come almost instantly (5-10 seconds).
I tried to simplify the main query, to remove some subqueries and sums, no result 'till now.
Does anybody faced this problem? Is there any solution, except re-writing the whole s/p from scratch?
Interested fact: I have a similar (not exactly the same, but same kind) of stored procedure, which retrieve from exact same tables similar data in a similar way for a report, and this is working fine...
Thanks in advance for any hint that may get me out of this problem.
Is better shut up and look stupid than open your mouth and eliminate any doubt