We help IT Professionals succeed at work.

TRY/CATCH

Is there a way in which I can force a TRY block to fail and move into the CATCH block?

Thanks
Comment
Watch Question

Commented:
select 1/0
Commented:
Hi,

By running RAISERROR with a severity of 11 or higher.


From http://msdn.microsoft.com/en-us/library/ms178592.aspx Remarks

"When RAISERROR is run with a severity of 11 or higher in a TRY block, it transfers control to the associated CATCH block. "


/peter

Author

Commented:
thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.