Re: trig errors



Daft Pict (brianjmclean@xxxxxxxxx) writes:
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?

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.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

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
.



Relevant Pages

  • Re: Scripting Databases
    ... Basically, if I want to script a number of tables, I can right hand ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: SQL 6.5 to 2000 Upgrade Troubles
    ... The easiest way in my opinion is to script everything and bulkload out ... data type may be the best - as long as you have no columns of the type ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.setup)
  • Re: Scripting Databases
    ... Basically, if I want to script a number of tables, I can right hand ... Again, T-SQL ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Run all .sql files (scripts) in project (SQL Server 2005 SP2)
    ... I have a database that is mid-conversion/redevelopment. ... script files is to open it up in SSMS and hit F5 for execute. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Help with a substring query
    ... How do I edit the script to capture these records? ... CASE WHEN str1 LIKE '%%' ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)