Click here to Skip to main content
15,884,836 members
Home / Discussions / Database
   

Database

 
AnswerRe: Stored Procedure Pin
SilimSayo30-May-11 2:31
SilimSayo30-May-11 2:31 
QuestionCopy table 1 to table 2 for missing data only Pin
MAW3026-May-11 17:02
MAW3026-May-11 17:02 
AnswerRe: Copy table 1 to table 2 for missing data only Pin
Blue_Boy26-May-11 21:14
Blue_Boy26-May-11 21:14 
AnswerRe: Copy table 1 to table 2 for missing data only Pin
PIEBALDconsult27-May-11 2:32
mvePIEBALDconsult27-May-11 2:32 
GeneralRe: Copy table 1 to table 2 for missing data only Pin
MAW3027-May-11 6:29
MAW3027-May-11 6:29 
GeneralRe: Copy table 1 to table 2 for missing data only Pin
jschell27-May-11 9:07
jschell27-May-11 9:07 
AnswerRe: Copy table 1 to table 2 for missing data only Pin
dasblinkenlight29-May-11 17:45
dasblinkenlight29-May-11 17:45 
QuestionProblem with POWER Pin
TheComputerMan26-May-11 4:14
TheComputerMan26-May-11 4:14 
I am getting an error message in an SQL statement that I don't understand

This is the statement:

UPDATE [QVSData].[dbo].[tbl_CentCatalogQVS]
SET [Energy] = (POWER(10,(4.8+([Magnitude]*1.5))))/POWER(10,3)
WHERE [AutoID] = 1

This is just a test hence restricted to 1 line to see if it works. It does not, and I am scratching my head as to why not.

This is the error:

Arithmetic overflow error for type int, value = 1995262314968882.700000

There is no int in the table. The affected fields here are:

The Mag field is a decimal field (10,4) with in this instance a value of 7.0000

The energy field is a decimal field (20,1)

Anyone have any ideas as to why this error is appearing?

Actually I make that value 1995262314968.8 so it seems that it is possibly falling over as it calculates the first part before doing the division to get to Kilojoules. Why is it using int?

To make it easier to figure out this error occurs if you run this:

DECLARE @mag decimal(10,4)
DECLARE @energy decimal(20,1)

SET @mag = 7
SET @energy = (POWER(10,(4.8+(@mag*1.5))))/POWER(10,3)

SELECT @energy

The you get:

Msg 232, Level 16, State 3, Line 5
Arithmetic overflow error for type int, value = 1995262314968882.700000.

(1 row(s) affected)

And the value is NULL

Sorry forgot to add: SQL Server 2005 Developer Edition
AnswerRe: Problem with POWER Pin
TheComputerMan26-May-11 4:27
TheComputerMan26-May-11 4:27 
GeneralRe: Problem with POWER Pin
SilimSayo26-May-11 7:46
SilimSayo26-May-11 7:46 
AnswerRe: Problem with POWER Pin
dasblinkenlight29-May-11 17:52
dasblinkenlight29-May-11 17:52 
GeneralRe: Problem with POWER Pin
TheComputerMan29-May-11 18:00
TheComputerMan29-May-11 18:00 
GeneralRe: Problem with POWER Pin
dasblinkenlight30-May-11 1:10
dasblinkenlight30-May-11 1:10 
GeneralRe: Problem with POWER Pin
TheComputerMan30-May-11 1:20
TheComputerMan30-May-11 1:20 
QuestionReseting memory in DB [modified] Pin
MAW3025-May-11 20:08
MAW3025-May-11 20:08 
AnswerRe: Reseting memory in DB Pin
Ravi Sant29-May-11 19:10
Ravi Sant29-May-11 19:10 
QuestionOracle invalid character Pin
Firo Atrum Ventus25-May-11 18:29
Firo Atrum Ventus25-May-11 18:29 
AnswerRe: Oracle invalid character Pin
_Damian S_25-May-11 18:52
professional_Damian S_25-May-11 18:52 
GeneralRe: Oracle invalid character Pin
Firo Atrum Ventus25-May-11 19:04
Firo Atrum Ventus25-May-11 19:04 
GeneralRe: Oracle invalid character Pin
_Damian S_25-May-11 19:17
professional_Damian S_25-May-11 19:17 
GeneralRe: Oracle invalid character Pin
Firo Atrum Ventus25-May-11 19:21
Firo Atrum Ventus25-May-11 19:21 
GeneralRe: Oracle invalid character Pin
_Damian S_25-May-11 19:22
professional_Damian S_25-May-11 19:22 
GeneralRe: Oracle invalid character Pin
Firo Atrum Ventus25-May-11 19:27
Firo Atrum Ventus25-May-11 19:27 
GeneralRe: Oracle invalid character Pin
_Damian S_25-May-11 19:33
professional_Damian S_25-May-11 19:33 
GeneralRe: Oracle invalid character [modified] Pin
Firo Atrum Ventus25-May-11 19:44
Firo Atrum Ventus25-May-11 19:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.