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.
Works fine:
Select FirstName, REPLACE(FirstName,N'İ','I') replaced
from Employee where FirstName = N'İAİL'
Fails when used as dynamic statement.
Same query fails to replace in dynamic statement.
DECLARE @SQL NVARCHAR(4000)
SET @SQL = 'Select FirstName, REPLACE(FirstName,N''İ'',''I'') replaced from Employee where FirstName = N'İAİL'
EXEC (@SQL)
Can you let me know why this fails in second condition?