Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arithmetic overflow 1

Status
Not open for further replies.

JoeZim

MIS
Sep 11, 2003
87
US
I'm getting the following error:

Arithmetic overflow error converting expression to data type datetime.

Here is the UPDATE Query:

Code:
Declare
	@record_number int,
	@parri_passu_debt money

Set @record_number = 4792
Set	@parri_passu_debt = 10

UPDATE balance
SET parri_passu_debt = @parri_passu_debt
WHERE record_number = @record_number

The field parri_passu_debt in the balance table has a data type money. How can I get a datetime overflow?

Been at this a while.

 
What type is record_number field?

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
I have no problem:
Code:
DECLARE @Test TABLE (parri_passu_debt money, record_number int)
INSERT INTO @Test VALUES (0,4792)

Declare
    @record_number int,
    @parri_passu_debt money

Set @record_number = 4792
Set @parri_passu_debt = 10

UPDATE @Test
SET parri_passu_debt = @parri_passu_debt
WHERE record_number = @record_number

SELECT * FROM @Test

Could you copy and paste exact error message.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Thanks for your help. Here is the exact error:

Msg 8115, Level 16, State 2, Procedure balance_update, Line 30
Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated.

I noticed it says Line 30, but there are not 30 lines in the statement.

 
Here is the table structure as well:

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[balance](
	[record_number] [int] NOT NULL,
	[parri_passu_debt] [money] NULL,
	[senior_mtb_debt] [money] NULL,
	[junior_debt] [money] NULL,
	[current_mtb_balance] [money] NULL,
	[available_balance] [money] NULL,
	[lc_balance] [money] NULL,
	[total_mtb_commitment_balance] [money] NULL,
	[overall_debt_stack] [money] NULL,
 CONSTRAINT [PK_balance] PRIMARY KEY CLUSTERED 
(
	[record_number] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
 
Is there a trigger on the table?

"NOTHING is more important in a database than integrity." ESquared
 
You nailed it SQLSister, the data types were wrong on the trigger. I just made the change and it worked! Thanks so much for that question, I was not considering the triggers.

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top