title: Select a scalar value from a table
body: <p><strong>Edit</strong>:
  The problem I had stemmed from a parameter-order mixup in my code. I sincerely appreciate everyone's help; my SQL understanding gets better each visit to SO.</p>
  
  <p>I am writing a stored procedure which needs to select a bit of information from another table in order to do its job.</p>
  
  <pre><code>DECLARE @configVar int;
  SET @configVar = (SELECT ExampleSetting FROM Settings WHERE SettingID = 1);
  -- do something with @configVar to get the final result set
  </code></pre>
  
  <p>Obviously (to people with a better understanding of SQL), the above is incorrect. No error, except when the stored procedure is executed, @configVar is set to NULL. I have double checked the table I'm SELECTing from and have ensured that the data exists.</p>
  
  <p>Can someone show my where my misunderstanding is, and how I should correct it? It seems like this might be a common idiom; how is this normally accomplished?</p>