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
 SQL Server Development (2000)
 error handling within step of a job

Author  Topic 

ur1o
Starting Member

1 Post

Posted - 2001-07-17 : 04:02:13
Hi there,

using this nice Microsoft T-SQL I got following problem:
I run a job which calls following stored procedure. But the behaviour is slightly different from Query Analyzer. Running the sp from a job it ignores the XACT_ABORT setting and stops after the first error occured. I want that it continues. Anybody any ideas?
Thx

CREATE PROCEDURE aaa AS

SET XACT_ABORT OFF

DECLARE @name as varchar(40)

DECLARE cur_replication CURSOR FOR

SELECT [name]
FROM replications

OPEN cur_replication

FETCH NEXT FROM cur_replication
INTO @name

WHILE @@FETCH_STATUS = 0
BEGIN
print @name
raiserror('Microsoft sucks!',16,-1)
print @name
FETCH NEXT FROM cur_replication
INTO @name
END

CLOSE cur_replication
DEALLOCATE cur_replication

go
   

- Advertisement -