March 31, 2010 at 5:32 am
hi,
I have about 10 update scripts in a SQL 2005 SP sometimes however they dont all update the table? no error messages are produced?
I have tried seperating some of the updates into other sps? but still sometimes they do not update?
any help on this would be awesome!
Thanks
March 31, 2010 at 6:15 am
It's impossibile to answer this question without seeing the code.
Please post table scripts and the stored procedure code.
If your tables have triggers defined, post their code too.
-- Gianluca Sartori
March 31, 2010 at 6:47 am
there are multiple update statements (about 16) in 1 sp all updating the same table but all have different where clauses so cant be completed in 1 update. however at least twice a week some of the updates do not update the data but when you then run them manually through a query they do? so we have to perform a 'data fix' each time.
UPDATE tblA
SET Field A = Field B
WHERE ....
UPDATE tblA
SET field c = field d
WHERE ...
March 31, 2010 at 6:56 am
sounds like a data problem: either the data being passed in doesn't find anything, causing a failure of some sort, or you're not passing in what you expect (perhaps 'a ' instead of just 'a'). Perhaps use TRY/CATCH mechanisms to see what might be erroring out or IF it was erroring out.
That said again, without seeing actual code and actual data, it may be very difficult to give you any kind of informed causes. I realize that may be problematic, but right now we're shooting in the dark.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
March 31, 2010 at 7:26 am
Just taking a guess, there's probably something in the WHERE clause that's preventing you from getting the updates. But, as everyone else has said, without specifics, I'm just guessing.
However, it seems like the most likely culprit, but I can't tell you specificall what to look at because I'm not there.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply