I am trying to remove a space and a no-break space from a varchar field i'm going to cast as an int, however, when using the replace method SQL Management Studio messes up the syntax after accepting it so I can't save it. This my query:
SELECT SZOMSCHRIJVING
FROM dbo.BETONKWALITEITEN AS b
WHERE (iBetonMengsel = CAST(REPLACE(p.SZBETONRECEPT, ' ', '') as INT))
After accepting this syntax, SQL Management Studio turns it into the following code:
SELECT SZOMSCHRIJVING
FROM dbo.BETONKWALITEITEN AS b
WHERE (iBetonMengsel = CAST(REPLACE('p.SZBETONRECEPT. . ',,) AS INT))
How do I replace the space and no-break space from this column?