title: sending an error message from SQL to the browser
body: <p>I have a stored procedure for checking business rules in a holiday booking system but I need it to return error messages if it fails so far I have been using if statements and the else(my error is in the else) looks as follows:</p>
  
  <pre><code>    BEGIN
          SELECT 'Error1'
      END
  </code></pre>
  
  <p>im using ASP adodb connection (apprentice in training) and this is how im trying to retrieve it:</p>
  
  <pre><code>     if not objDBRS.EOF then
          Session("Error") = objDBRS(0)
              if Session("Error") = "Error1" Then
                  Response.Write("&lt;SCRIPT LANGUAGE=""JavaScript""&gt;alert(""you cannot book more than 10 days off"")&lt;/SCRIPT&gt;")
              End If
  end if
  </code></pre>
  
  <p>Currently it works correctly the stored procedure and doesn't do the code if it fails but the error is not returned to the browser for some reason so it doesn't hit the ASP if statement. so it works just doesn't get the client side JS message.</p>