Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Other SQL Server Topics / January 2008

Tip: Looking for answers? Try searching our database.

trig errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daft Pict - 30 Jan 2008 16:34 GMT
Greetings,
I am getting a data conversion error I cannot explain!

This statement

UPDATE dbImageList
set cx = COS(RADIANS(CRVAL2))*COS(RADIANS(CRVAL1)),
    cy = COS(RADIANS(CRVAL2))SIN(RADIANS(CRVAL1)),
    cz = SIN(RADIANS(CRVAL2))

results in this error message
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type float.
The statement has been terminated.

However, all fields crval1,crval2,cx,cy,cz are datatype float in the
table.

Any suggestions on how to perform this computation?
Thanks
-Brian
Erland Sommarskog - 30 Jan 2008 22:48 GMT
> Greetings,
> I am getting a data conversion error I cannot explain!
[quoted text clipped - 15 lines]
>
> Any suggestions on how to perform this computation?

I would certainly help if you could post a script that demonstrates
the problem. That is, the script would include the CREATE TABLE statement
for the table, and INSERT statements for data that causes this problem.

Else we are left a bit in the dark.

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Ed Murphy - 31 Jan 2008 04:18 GMT
> Greetings,
> I am getting a data conversion error I cannot explain!
[quoted text clipped - 4 lines]
> set cx = COS(RADIANS(CRVAL2))*COS(RADIANS(CRVAL1)),
>      cy = COS(RADIANS(CRVAL2))SIN(RADIANS(CRVAL1)),

There's a missing * here; is that typo in your actual code, or did it
just sneak in when you wrote your post?

>      cz = SIN(RADIANS(CRVAL2))
>
[quoted text clipped - 7 lines]
>
> Any suggestions on how to perform this computation?

First try it with a WHERE clause that limits it to a single row of the
table.  If that succeeds, then do a few binary chops to determine which
rows do or don't have problems.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.