I have a stored procedure that works with no issues, that is the return code is 0. In some cases I RAISERROR a user defined error (> 50000). In those cases the return is -6. I am just curious, what does -6 mean? I do not set the return code in the procedure, so this number is SQL Server (system) generated.
I found this statement:
Whether these negative numbers have any meaning, is a bit difficult to
tell. It used to be the case, that the return values -1 to -99 were
reserved for system-generated return values, and Books Online for
earlier versions of SQL Server specified meanings for values -1 to
-14. However, Books Online for SQL 2000 is silent on any such
reservations, and does not explain what -1 to -14 would mean.
Does anyone know the “hidden” meanings to these return codes?
I am using SQL Server 2008 R2.
OK, I found this…
Return value from a stored proc on error
In my case, the severity of the error I was raising was 16, so 10 – 16 = -6.
Thanks everyone for thier input.