>>>>I see, let me try. Also check your PM and I'm still wondering how can I quickly jump to the Help on the Error Message.
>>>
>>>I read it, but I have problems with connection to my SQL Server right now. Adobe is downloading its Update and get ALL my network power :-)
>>
>>No rush, I'm manually setting parameters in this SQL statement now. I hate manual typing... :)
>
>HA!
>I think you will not have problems with that. You should use all 6 pairs of hands (Buddha) :-))))
>I just sent you a PM, no need to write ALL parameters.
Well, in addition to lack of extra hands I have a problem with keyboard. It sometimes has mind on its own and starts repeating some letters or numbers. For instance, a minute ago it was typing 66666666666666. Should I consider this as a bad sign? :)
Anyway, while it was doing it I went and took a cup of capuchinno (we have vending machine) and now after I finished typing and executed it it gave me this error (after the normal caught error).
Msg 266, Level 16, State 2, Procedure PersonUpdate, Line 0
Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.
So I guess my CATCH block is written wrongly.
BEGIN CATCH
DECLARE @ErrorSeverity int, @ErrorNumber int,
@ErrorMessage nvarchar(4000), @ErrorState int,
@ErrorLine int, @ErrorProc nvarchar(200)
SET @ErrorSeverity = ERROR_SEVERITY()
SET @ErrorNumber = ERROR_NUMBER()
SET @ErrorMessage = ERROR_MESSAGE()
SET @ErrorState = ERROR_STATE()
SET @ErrorLine = ERROR_LINE()
SET @ErrorProc = ERROR_PROCEDURE()
SET @ErrorMessage = 'Problem updating person''s information.' + CHAR(13) +
'SQL Server Error Message is: ' + CAST(@ErrorNumber AS VARCHAR(10)) +
' in procedure: ' + @ErrorProc +
' Line: ' + CAST(@ErrorLine AS VARCHAR(10)) +
' Error text: ' + @ErrorMessage
IF @ErrorState = 0
SET @ErrorState = 1
RAISERROR (@ErrorMessage , @ErrorSeverity, @ErrorState, @ErrorNumber)
IF XACT_STATE() < 0
ROLLBACK TRANSACTION
END CATCH
Looks like RaiseError should be the last statement in the catch, right?
I think I took this directly from Kevin, so he also may have this problem.
If it's not broken, fix it until it is.
My Blog