title: replace function does not work in dynamic sql query
body: <p>I am facing an problem in replacing the character in sql query. I am using vs 2008. I am trying to replace the Turkish character İ to I.</p>
  
  <p>Works fine:</p>
  
  <pre><code>Select FirstName, REPLACE(FirstName,N'İ','I') replaced 
  from Employee where FirstName = N'İAİL'
  </code></pre>
  
  <p>Fails when used as dynamic statement.</p>
  
  <p>Same query fails to replace in  dynamic statement.</p>
  
  <pre><code>DECLARE @SQL NVARCHAR(4000)
  SET @SQL = 'Select FirstName, REPLACE(FirstName,N''İ'',''I'') replaced from Employee where FirstName = N'İAİL'
  EXEC (@SQL)
  </code></pre>
  
  <p>Can you let me know why this fails in second condition?</p>