SQLServer 2005 - Change character in NVarChar
I receive some arguments into a stored procedure. These arguments are NVARCHAR's.
I have a problem, when I need to cast some of these values to FLOATS, because they are being received as e.g.
DECLARE @ChangedValue SET @ChangedValue = CAST(@Value1 AS FLOAT)
E.g. @Value1 = "0,001"
Gives me a problem, as it expects "0.001"
I can't change the format of the input, but can I somehow change it on the SQL-server side? By changing all "," to "." instead?
Best regards, Kenn
You could use @VALUE1 = REPLACE(@VALUE1, ',', '.')
This does seem a horrible thing to do though!