title: MSSQL replace with concatenation on parameters - Syntax error
body: <p>I am trying to write a stored procedure that concatenates a comma as a prefix to a parameter within the REPLACE function like this:</p>
  
  <pre><code>update [SQSDBA].[M_PARAMSTRINGS] set PARAMCHAR = REPLACE([PARAMCHAR], ',' + @CurrentCompanyCode, ',' + @NewCompanyCode)
  </code></pre>
  
  <p>But I am getting the following error:</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Procedure ChangeCompanyPrefix, Line 248
    Incorrect syntax near ')'.</p>
  </blockquote>
  
  <p>How should I do it?</p>