• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

Error converting data type numeric to numeric

Hello,

Wen I try to insert 48439806668.76 in a column (numeric(18,8),null), the error Error converting data type numeric to numeric is returned.
Why?

Thanks
0
bibi92
Asked:
bibi92
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
For just the one column, works for me in 2012.
CREATE TABLE #tmp (no numeric(18,4) null)
GO

INSERT INTO #tmp (no)
VALUES(48439806668.76)

SELECT * FROM #tmp
GO

Open in new window

Couple of possibilities
Are there any triggers on this table, where the error is the result of the trigger?
Is the error because of a different column in your INSERT statement?
0
 
Kent OlsenData Warehouse Architect / DBACommented:
The data overflows the descriptor.

number(18,8) is a value with 10 digits left of the decimal, and 8 to the right.

  48439806668 is 48,439,806,668

That's an 11 digit value, one too many digits to fit into 10 .



Kent
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now