I read that
ERROR_STATE() can help to distinguish between different states/locations in the source code where same type of error can occur. But it is not really clear to me that how it can be useful.
ERROR_STATE()Returns the state number of the error that caused the CATCH block of a TRY…CATCH construct to be run.
How it can be really used? Can some one give me an example, the ones provided in this reference article don't really help explain things well for me?