title: determine if any values are null, if true then false, else true
body: <p>I currently have a select statement that checks several columns to see if they have data.  if any of them are null then i want a bit set to false.  if none of them are null then i want a bit set to true.  here's what i currently have:</p>
  
  <pre><code>select
  cast(
          case when ChangeOrderNumber is null then 0 else 1 end *
          case when ClientName is null then 0 else 1 end *
          case when QuoteNumber  is null then 0 else 1 end *
          case when ClientNumber is null then 0 else 1 end *
          case when ServiceLine is null then 0 else 1 end *
          case when ServiceLineCode is null then 0 else 1 end *
          case when GroupLeader is null then 0 else 1 end *
          case when CreatedBy is null then 0 else 1 end *
          case when PTWCompletionDate is null then 0 else 1 end *
          case when BudgetedHours is null then 0 else 1 end *
          case when BudgetDollars is null then 0 else 1 end *
          case when InternalDeadlineDate is null then 0 else 1 end *
          case when ProjectDescription is null then 0 else 1 end *
          case when Sales is null then 0 else 1 end *
          case when Coop is null then 0 else 1 end *
          case when PassThrough is null then 0 else 1 end *
          case when POStatus is null then 0 else 1 end *
          case when PONumber is null then 0 else 1 end as bit
      ) 
      as Flag
  from t
  </code></pre>
  
  <p>now, that code works, but it's a bit lengthy, i was wondering if anyone knew of a better way to do this.  please note that there are several data types being checked.</p>
  
  <p>further details:
  this code is in a view that is being looked at in an application for processing change orders.  before a change order can be processed it must meet some data quality checks.  this view shows if any of the required data is null.</p>