title: Case statement in Update query based on Row data
body: <p>I have a table with the following structure:</p>
  
  <pre><code>ID int (primary key)
  SectionName varchar(50)
  Allowed bit
  </code></pre>
  
  <p>For example there are 5 sections:</p>
  
  <pre><code>ID   SectionName     Allowed
  -----------------------------
  1    Basement          1
  2    First Floor       1
  3    Second Floor      1
  4    Third Floor       1
  5    Parking           1
  </code></pre>
  
  <p>I have a C# application that will call a stored procedure with the following parameters populated </p>
  
  <pre><code>@Basement = false
  @First_Floor = true
  @Second_Floor = true
  @Third_Floor = false
  @Parking = true
  </code></pre>
  
  <p>After I executed the result of the stored procedure, I would like the values to look like </p>
  
  <pre><code>ID   SectionName     Allowed
  ----------------------------
  1    Basement          0
  2    First Floor       1
  3    Second Floor      1
  4    Third Floor       0
  5    Parking           1
  </code></pre>
  
  <p>How would I create this stored procedure in Microsoft SQL Server. </p>