开发者

SQL Server 2000 invalid Floating Point Operation

开发者 https://www.devze.com 2023-01-11 06:34 出处:网络
When I run my .net app connected to SQL Server 2000, I get the error \"invalid Floa开发者_JAVA百科ting Point Operation\". I did search for the error cause http://fugato.net/2005/02/08/sql-server-nasti

When I run my .net app connected to SQL Server 2000, I get the error "invalid Floa开发者_JAVA百科ting Point Operation". I did search for the error cause http://fugato.net/2005/02/08/sql-server-nastiness found this link which says there may be Bogus Data in one of the columns.

I have a backup from a month old data, when I connect to the old database it works fine.

How do I filter out the bogus data in the table?


One method might be to use a cursor to perform the problematic operation row by row printing id's as you go along, when the error occurs you can refer to the printed id's to see which row contains the erroneous data.

There is probably a better way however, this is just what came to mind!


You need to narrow down your problem:

  • When exactly does this happen? What SQL query is being executed that causes the problem??

  • Once you have the query - look at what the query does; check those tables - are you possibly converting a VARCHAR field into a numeric value, and some values aren't all numeric?

  • Or are you reading data using a SqlDataReader and you're not paying attention to the fact the data contained in SQL Server might not be what you expect??


select col
from tbl 
group by col 
having count(col) = 1

there's probably only one instance of the bad value


Do you know which table(s) are causing the problem? Can you run a SELECT * FROM... against these tables + get results? If so, select from the tables and order by each of the FLOAT / REAL / NUMERIC / DECIMAL columns and look at the ends to see if there are any 'oddities'.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号