SQL Stored Procedure Exception Not Found in JAVA
问题 Throwing exception from sql stored procedure catch block is not raising exception in java layer for SP1 while for SP2 exception raised. When I am executing both SPs are giving exception in SQL Server but from java code I got no exception for SP1. I am calling both SPs using JPA StoredProcedureQuery and using Hibernate & Spring. CREATE PROCEDURE SP1 AS SET NOCOUNT ON BEGIN TRY DECLARE @ErrorMessage AS VARCHAR(MAX) SELECT 1/0 END TRY BEGIN CATCH THROW 50001, @ErrorMessage, 1; END CATCH CREATE