Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Sproc Error Logging

Author  Topic 

mdelgado
Posting Yak Master

141 Posts

Posted - 2004-09-30 : 09:45:52
I have one stored Procedure whose only job is to run 30 stored procedures every night. THe problem is that if the 2nd stored procedure in the batch fails, then the rest of the sprocs don't even run. Any Ideas on how I can fix?

I.E.
creat proc spMain
as

exec spA
exec spB
exec spC...

go

exec spMain

If spA fails, then B and C don't run.

tuenty
Constraint Violating Yak Guru

278 Posts

Posted - 2004-09-30 : 10:48:21
try using a DTS instead where u can specify if the package should fail if a step fails of if it can just keep on going, you can stablish precedence and keep a log for each step and for the DTS itself

*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*

A candle loses nothing by lighting another candle
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-01 : 03:28:18
you need to handle the error, i think this has been tackled before, try searching the forum.

example: exec @err=master..xpcmdshell @command
so even if the error is encountered you'll have the impression of a resume next
Go to Top of Page

tuenty
Constraint Violating Yak Guru

278 Posts

Posted - 2004-10-01 : 15:00:16
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=40677

*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*

A candle loses nothing by lighting another candle
Go to Top of Page
   

- Advertisement -