What is ERROR_STATE() in SQL Server and how it can be used?
The purpose of SQL Server error states is for the SQL Server development team to be able to identify in code the exact place system errors were raised, given that many errors are raised in multiple places.

You as an end user (ie. developer of applications using SQL Server) can similarly use the state passed in to RAISERROR so that your product support can identify the place a procedure raises an error, for example:

create procedure usp_my_proc
as
if &lt;somecondition&gt;
  raiserror(N'Error foo and bar', 16, 0);
if &lt;someothercondition&gt;
  raiserror(N'Error foo and bar', 16, 1);
go


See how the two state allow you to distinguish later which error case was hit. Before you say 'but I can look at the error message' I'm telling you one word: internationalization.