title: SQL Server - Constraint to prevent two columns having specific values at the same time
body: <p>I have a table PO_HEADER -</p>
  
  <pre><code>PO_NO | STATUS | AUTHORISATION DATE | AUTHORISATION CODE | ....
  </code></pre>
  
  <p>In my application a PO is created with a status of 8 and then after authorisation the status is changed to 1.  My problem is that sometimes when the PO is being saved it is getting the status 1 instead of 8 despite there not being any code (that I can find) that does that.</p>
  
  <p>So, is it possible to create a constraint that would prevent an update that tries to set "STATUS" to 1 while leaving "AUTHORISATION CODE" blank(null)?</p>