title: How to add variables in Dynamic Sql, not concatenate them?
body: <p>I have the following dynamic sql statement where I want to add @StartRowIndex + @MaximumRows and subtract 1 from it.  I am unclear on where to put the single quotes in the statement.  Here it is:</p>
  
  <pre><code>SET @sql = @sql + ' SELECT *
   FROM
  LicenseInfo
  WHERE RowNum 
  BETWEEN ' + @StartRowIndex + ' AND ' + 
  '(' + @StartRowIndex + @MaximumRows + ')'  -  1
  + ' ORDER BY cnt desc'
  </code></pre>