I'm trying to use the replace function in order to replace some characters with some others : 

```
if(@remarkspx like '%*0702*%') 
    begin
        replace(replace(@RemarksPX, '@', '.'), '#', '@')
        --print 'hello'
    end

```

When I'm running this "double replace" in a select query, it is perfectly working without any issue. However, here in this if block, I'm getting an error saying **Incorrect syntax near 'replace'**. If I'm using the print, everything works fine.

Any idea on what's going on?