peleg
SSCrazy
Points: 2611
More actions
July 23, 2009 at 1:52 pm
#137012
i am catching error's in a STORED PROCEDURE using TRY/CATCH.
I want to continue receiving errors in certain instances while still using TRY/CATCH
what is the right way to do it?
Thanks
Peleg
Michael Valentine Jones
SSC Guru
Points: 64818
July 23, 2009 at 1:55 pm
#1029260
You can just raise an error in the CATCH block.
Carleton
SSCommitted
Points: 1706
July 23, 2009 at 4:44 pm
#1029361
Here's how you can do it:
begin try
declare @varchar varchar(100)
set @varchar = 1 + 'This will error out'
end try
begin catch
Declare @ERROR_MESSAGE varchar(max)
set @ERROR_MESSAGE = ERROR_MESSAGE()
RAISERROR(@ERROR_MESSAGE,11,1)
end catch
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply