views:

588

answers:

2

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?

+3  A: 

Try

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

Then run your select again.

cmsjr
A: 

Brilliant, that worked - thanks cmsjr

Joda
np, my pleasure.
cmsjr