Articles → SQL SERVER → Exception Handling In SQL Servers
Exception Handling In SQL Servers
Try Catch Throw
- Try → In the try block, we write the code that may cause an exception
- Catch → In the catch block, we write the code to catch the exception
- Throw → The throw is used to rethrow the exception
Example
Begin Try
select 7/0
End Try
Begin Catch
throw
End Catch
Output
Click to Enlarge