NaN Values in a float field in MSSQL Database

2020-07-18 07:19发布

问题:

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?

回答1:

Try

UPDATE xxx SET column= null WHERE IsNumeric(column)=0

Then run your select again.