I've a trigger in a sql server database with a very strange behavior, these are the strange instructions:
...
EXEC [ope].[spMissionDepartment] @AircraftId = @vnAircraftId
RAISERROR('test error', 16, 1)
END TRY
BEGIN CATCH
SELECT @ErrorMessage = ERROR_MESSAGE()
ROLLBACK TRANSACTION
RAISERROR(@ErrorMessage, 16, 1) -- strange line
END CATCH
The strange behavior is this:
If I remove the strange line than I receive in web page the error
TIMEOUT EXPIRED. THE TIMEOUT PERIOD ELAPSED PRIOR TO COMPLETION OF THE OPERATION OR THE SERVER IS NOT RESPONDING.
otherwise, if I don't remove the strange line, I receive the error
test error
There are no other triggers, so the exec should be the last statement executed, how is possible that I receive a Timeout only without the Raiserror?