title: Use of '' + in SQL Server 2005 Stored Procedure to build SQL string
body: <p>I'm building a stored procedure which is rather stretching my experience. With the help of people who responded to this thread [<a href="https://stackoverflow.com/questions/1863527/nested-if-statements-in-mssql-stored-procedure-select-statement][1]">Nested if statements in SQL Server stored procedure SELECT statement</a> I think I'm most of the way there :)</p>
  
  <p>In short, the SP takes a series of paramterised inputs to dynamically build an SQL statement that creates a temporary table of id values ordered in a specific way. The remainder of the SP, which returns the data according to the requested page from the id values in this temporary table is all sorted.</p>