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:
SET @sql = @sql + ' SELECT *
FROM
LicenseInfo
WHERE RowNum
BETWEEN ' + @StartRowIndex + ' AND ' +
'(' + @StartRowIndex + @MaximumRows + ')' - 1
+ ' ORDER BY cnt desc'