I'm trying to convert data from a column in NVARCHAR (255) to DECIMAL (10,2), however, all the ways I tried it always gives the same error Error converting data type nvarchar to numeric . I created another column of type DECIMAL (10,2) to transfer the data of the column of type NVARCHAR (255), but even with CONVERT or CAST also does not convert. Here is the code below:
SELECT CASE
WHEN Isnumeric(salario) 0 THEN CONVERT(NVARCHAR(255),
CONVERT(DECIMAL(10, 2), salario))
ELSE salario
END AS [SALÁRIO]
FROM dbo.rendimentos