title: Query SQL database from Excel
body: <p>I'm attempting to create a MS Query to return data from a SQL database based on a value from a cell in Excel. I have actually successful accomplished this, but only for 1 row.  I cant figure out how to get it to copy-down to other rows.</p>
  
  <p>I've created a connection as follows:
  <a href="https://i.stack.imgur.com/Kstz2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kstz2.jpg" alt="enter image description here"></a></p>
  
  <p>Notice that the SQL statement includes a parameter. The parameter is set to point to a specific cell:
  <a href="https://i.stack.imgur.com/UWpFU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UWpFU.jpg" alt="enter image description here"></a></p>
  
  <p>I guess this makes sense as I'm only looking to return 1 value per row:The problem is that I have multiple lines to return values for. How do I return a value per row for multiple rows? </p>
  
  <p>I've tried changing the cell reference in the Parameters dialog box, but this does not work as the Excel Table is designed to grow dynamically.</p>