title: T-SQL String Replace
body: <p>I need to replace the tag {URL}:</p>
  
  <pre><code>DECLARE @PageUrl varchar(200)
  DECLARE @Body varchar(MAX)
  
  SET @PageUrl = 'http://www.website.com/site1/site2/pageName.asxp?rid=1232'
  SET @Body = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus, 
  {URL} enim nec posuere volutpat, neque dui volutpat turpis. '
  
  SET @Body = REPLACE(@Body,'{Url}', CONVERT(varchar,@PageUrl))
  PRINT @Body
  </code></pre>
  
  <p>My expected result is:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus,
  http://www.website.com/site1/site2/pageName.asxp?rid=1232 enim nec posuere volutpat, neque dui volutpat turpis.
  </code></pre>
  
  <p>And the print result is:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus,
  http://www.website.com/site1/s enim nec posuere volutpat, neque dui volutpat turpis.
  </code></pre>
  
  <p>As you can see the replace function cuts the url string at its 31... </p>
  
  <p>What I'm doing wrong?</p>