|
-
Jan 28th, 2004, 09:52 PM
#1
Thread Starter
Lively Member
@ERROR not working
I wrote a store procedure like the following
create procedure....as
begin
declare @e int
select @e = 0
begin trans
insert.....
if @@ERROR<>0
begin
@e = @@ERROR
print "...."
end
if @@ERROR<>0
begin
@e = @@ERROR
print "...."
end
if @e=0 then
commit transaction
else
rollback transaction
return 0
it is not working....when any error (especially wrong table name)...it is raising an error and no commit or rollback getting executed in the second statement....no other setting is made apart from the above code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|