CREATE PROCEDURE [dbo].[USP_TESTEXCEPTION]
@Param1 AS INT,
@Param2 AS INT
AS
BEGIN
SET NOCOUNT ON;
UPDATE TABLE1 SET COLUMN1 = @Param1
SELECT @Param1, @Param2; // This select is causing problem.
SELECT @Param/0;
UPDATE TABLE2 SET COLUMN2 = @Param2
END
I am working on a Spring MVC project with SQL server 2012 back end. I am calling the following SP from my DAO layer and transaction is handled from application layer. Problem is this procedure is not raising any exception in application layer and for that partial transaction occurred(TABLE1 is being updated while TABLE2 is not). Why this SP is not raising exception in application layer?