I am trying to put some error handling into a couple of sprocs by using RAISERROR, that will be throw in my VB.NET application
I am starting simple:
But this doesn't actually throw an error in my application. If I remove the select line an error is thrown as I want. Surely it should throw an error whether there is one or not if a RAISERROR is encountered?
I am starting simple:
CREATE PROCEDURE sp_test_transaction
AS
SELECT * FROM Saturn..gn_Colours
RAISERROR ('Error in deleting department in DeleteDepartment.', 16, 1)
RETURN
GO
AS
SELECT * FROM Saturn..gn_Colours
RAISERROR ('Error in deleting department in DeleteDepartment.', 16, 1)
RETURN
GO
But this doesn't actually throw an error in my application. If I remove the select line an error is thrown as I want. Surely it should throw an error whether there is one or not if a RAISERROR is encountered?