NaN Values in a float field in MSSQL Database
-
19-08-2019 - |
Question
I am working on an old database I inherited from my predecessors.
In it, some float fields contains NaN where there should be a null.
The following SQL doesn't work because it doesn't recognize NaN.
UPDATE xxx SET column= null WHERE column=NaN
How can I do this?
Solution
Try
UPDATE xxx SET column= null WHERE IsNumeric(column)=0
Then run your select again.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow