You are here: Re: math error « MsSQL Server « IT news, forums, messages
Re: math error

Posted by othellomy on 11/24/06 04:32

Hi Madhivanan,
Thanks for the input. The column type is varchar where the value
1.2334e+006 is stored. So I need to convert it to float as suggested by
some before converting it to decimal. Anyway, that brings another
issue. When running the query the server just errors out without giving
the value that causes the error. It just says 'conversion error'. I
had to take the SQl out and put it in a cursor and use a loop to find
out which row is actually causing the error and find the value
1.2334e+006. Is there any easier way to find out which row in the table
causes the SQL server to error out. For example can I set the error
level so that I find more information so that I can locate the row in
the table.
Thanks.

Madhivanan wrote:
> othellomy@yahoo.com wrote:
> > select convert(float,'1.2334e+006')
> > 1233400.0
> >
> > select convert(decimal(20,2),'1.2334e+006')
> > Server: Msg 8114, Level 16, State 5, Line 1
> > Error converting data type varchar to numeric.
> >
> > can I set some options arithabort etc to have a workaround to this
> > problem?
> > Thanks.
>
> Try
>
> select convert(decimal(20,2),1.2334e+006)
>
> Madhivanan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация