Help needed: arithmetic overflow error converting numeric to data type numeric

Hi, I have a SQL server 2005 db. The table structure (from big list of columns, only decimal columns I mentioned) below. 

CREATE TABLE [Product].[MetricMeasures](
    [MetricMeasureID] [int] IDENTITY(1,1) NOT NULL,
    [ProductID] [int] NOT NULL,
    [ProductSizeValue] [decimal](4, 2) NULL,
    [ItemWeightValue] [decimal](3, 3) NULL,
    [MasterCartonWeightValue] [decimal](3, 3) NULL,
    [MasterCartonVolumeValue] [decimal](4, 4) NULL,
 CONSTRAINT [PK_MetricMeasures] PRIMARY KEY CLUSTERED
(
    [MetricMeasureID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 

When I tried to enter below values to the table and I am getting the error "Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated."

MetricMeasureID | ProductID | ProductSizeValue | ItemWeightValue | MasterCartonWeightValue | MasterCartonVolumeValue

(Auto num)         |        1       |            0.22         |           0.149         |              1.020                  |              0.0040

I need advice. Do I need to modify the datatype in the table structure?

0
nzkks
3/26/2009 8:08:40 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

2 Replies
889 Views

Similar Articles

[PageSpeed] 40

change to:

 CREATE TABLE [Product].[MetricMeasures](
    [MetricMeasureID] [int] IDENTITY(2,1) NOT NULL,
    [ProductID] [int] NOT NULL,
    [ProductSizeValue] [decimal](4, 2) NULL,
    [ItemWeightValue] [decimal](6, 3) NULL,
    [MasterCartonWeightValue] [decimal](6, 3) NULL,
    [MasterCartonVolumeValue] [decimal](8, 4) NULL,


Regards,
Stefan Uzunov
0
Steelymar
3/26/2009 8:16:48 AM

Thanks for the answer. Other than "[MetricMeasureID] [int] IDENTITY(2,1) NOT NULL," I changed all and it worked.

0
nzkks
3/26/2009 8:35:11 AM
Reply:

Similar Artilces:

SQL Server Error: "Arithmetic overflow error converting numeric to data type numeric"
I'm still quite new to SQL, and so I may be missing something quite obvious. Apologies in advance if that's the case. I've included my query at the bottom of the message as it is quite long; my problem is that I get "Arithmetic overflow error converting numeric to data type numeric" when the first parameter to my COALESCE calls is not NULL. That is, the COALESCEs and the query work as I expect when SUM(cust_vw_actual.Actual) is NULL (they return 0.00), but if it isn't I get the error. I am also getting "Warning: Null value eliminated from aggregate.&...

Arithmetic overflow error converting float to data type numeric.
When this code executes, I am getting the error list in the subject. The values of the items are as follows: newTextName = SM1 newLat = 29.1878 newLong = 85.3417 newDescription = Test newCreator = John newCreate_Date = 9/14/2003 newDepth = 61 DropDownList2 = 7 'Get next Text_ID from Waypoint Table stmMaxSQL = "Select Max(WP_Text_ID) as WP_Text_ID From TBL_NM_Waypoint" objConn.Open() dadWaypoints = New SqlDataAdapter(stmMaxSQL, objConn) dadWaypoints.Fill(dstWaypoints, "Waypoints"...

Arithmetic overflow error converting varchar to data type numeric
Hello, i am getting "Arithmetic overflow error converting varchar to data type numeric"  while i am trying to cast the numeric value to varchar in SQL Server 2000(This is the Query  (cast(' + @Qty + ' as varchar(50)) If any knows plz help me, thanks.        "Arithmetic overflow error converting varchar to data type numeric" stands for error while converting varchar to numeric, and you say "trying to cast the numeric value to varchar", this is kind a confusing thing. Can you explain your problem more detailed?Nev...

Arithmetic overflow error converting float to data type numeric.
When this code executes, I am getting the error listed in the subject. The error is reported on the underlined and bold line. The values of the items are as follows: newTextName = SM1 newLat = 29.1878 newLong = 85.3417 newDescription = Test newCreator = John newCreate_Date = 9/14/2003 newDepth = 61 DropDownList2 = 7 'Get next Text_ID from Waypoint Table stmMaxSQL = "Select Max(WP_Text_ID) as WP_Text_ID From TBL_NM_Waypoint" objConn.Open() dadWaypoints = New SqlDataAdapter(stmMaxSQL, objConn) ...

PB 11.2/MS SQL 2005 Error converting data type varchar to numeric
Am getting the above error from PB 11.2 when executing a stored proc. The proc take no parameters. Once i get this error, i cannot execute the proc succesfully from PB 11.2 until i recompile the stored proc. At the same time the proc works fine from Query Analyzer, as well as from PB 7. What is PB 11.2 doing to mess this up? Any ideas....it's wrecking havoc on our production app. Forgot to add the error is C0195:SQLSTATE =3D 22018 On Dec 13, 4:00=A0pm, bre...@friesens.com wrote: > Am getting the above error from PB 11.2 when executing a stored proc. > The proc take no...

Error = Arithmetic overflow error converting expression to data type smalldatetim
  $exception {"Arithmetic overflow error converting expression to data type smalldatetime.\r\nThe statement has been terminated."} System.Exception {System.Data.SqlClient.SqlException} occurs here is my code protected void EmailSubmitBtn_Click(object sender, EventArgs e) { SqlDataSource NewsletterSqlDataSource = new SqlDataSource(); NewsletterSqlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["NewsletterConnectionString"].ToString();   //Text version NewsletterSqlDataSource.InsertCommandType = SqlDataSourceCommandType.Text; NewsletterS...

System.Data.SqlClient.SqlException: Error converting data type numeric to decimal.
Hi There, I'm using C# to get a value for a DOUBLE precision variable, called "Length", from a textBox using the following line: Length = Convert.ToDouble( txtLength.Text ) I'm also using the following lines to prepare my stored procedure call: arParms[9] = new SqlParameter("@Length", SqlDbType.Decimal, 5); arParms[9].Value = record.Length; My stored procedure has the following parameter definition: @Length decimal(9,3) My problem is that if someone types a value bigger than 999999 in the textbox he will get for sure the following error: System....

Formview gives Error converting data type nvarchar to numeric error when comma is in the input
I have a formview that collects various data including money and decimal data. I had a problem where the $ was casuing the "Error converting data type nvarchar to numeric" error and think I corrected it by changing the format to {0:C} for the field in the data bindings. I am still having an issue with commas in the data in a decimal field. The field in the database is decimal (14,9) and the format in the textbox in the formview is {0:n}. The data being input is something like 123,456.0. This gives the Error converting data type nvarchar to numeric error. If you remove the comma, 1...

Trying to convert column from datatype nvarchar to datetime
Hi All,  I am trying to simply change a column from a datatype of nvarchar to a datetime datatype.  However when I do I receive the following error message: " Arithmetic overflow error converting expression to data type datetime."To note there is already a date filled out in the columns which I presume the reason why the error is reporting?! however for some reason when originally setup datetime was not used but rather nvarchar to capture the data.The format is: 16/01/2007 09:53:50 There are around 24000 entries that I need converting somehow so if anyone can help...

Error converting data type nvarchar to numeric.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Error converting data type nvarchar to numeric.Source Error: Line 73: cmd1.Parameters.AddWithValue("@edate", edate); Line 74: cmd1.Parameters.AddWithValue("@phone", phone); Line 75: cmd1.ExecuteNonQuery(); Line 76: con.Close(); Line 77: How to solve this problem......

Help needed Error converting data type
Hi All, I am getting the following error when executing an update when the textbox in question has nothing in it. The datatype in Sql is Decimal and it works okay if there is a number in the textbox. I do want to allow a null entry and I have a Compare Validator in place to check for a numeric value. The textbox in question is txtActTime. So what do I need to do when there is nothing in txtActTime.text for the update to execute successfully? Thanks Conversion from string "" to type 'Decimal' is not valid.          &n...

Error converting data type varchar to numeric
hi All, This case statement is giving me the error "Error converting data type varchar to numeric". the column dbo.tblKMTermloanFees.base_min datatype is varchar.  And please see below for sample data in the column. i have to convert this into number. Any suggestions guys how to do this, Thanks in advance. Shilpa.  CASE  WHEN dbo.tblKMTermloanFees.base_min LIKE '%/6M%' THEN CONVERT (DECIMAL (5,2), LEFT (Base_Min, CHARINDEX ('/', Base_Min)-1)) / 6 WHEN dbo.tblKMTermloanFees.base_min LIKE '%/M%' THEN CONVERT (DECIMAL (5,2), LEFT (Base_Mi...

Error converting data type varchar to numeric.
following is the error I am getting. Exception Details: System.Data.SqlClient.SqlException: Error converting data type varchar to numeric.Source Error: Line 107: " select '" & eventnumber & "','" & username & "','" & requestor & "', '" & bcode & "', max([Loan_ID]) from loan "Line 108: Dim myCommand1 As New SqlCommand(sql1, myConnection)Line 109: myCommand1.ExecuteNonQuery()Line 110:Line 111: Dim sql2 As String = " update Equipment set [Available_for_Loan] = 0 where barcode = '" &am...

Arithmetic overflow error converting expression to data type datetime
Hi all,In the beginning of this month I've build a website with a file-upload-control. When uploading a file, a record (filename, comment, datetime) gets written to a SQLExpress database, and in a gridview a list of the files is shown. On the 7th of September I uploaded some files to my website, and it worked fine. In the database, the datetime-record shows "07/09/2006 11:45". When I try to upload a file today, it gives me the following error: Error: Arithmetic overflow error converting expression to data type datetime. The statement has been ...

Web resources about - Help needed: arithmetic overflow error converting numeric to data type numeric - asp.net.sql-datasource

Arithmetic - Wikipedia, the free encyclopedia
... of numbers , especially the properties of the traditional operations between them— addition , subtraction , multiplication and division . Arithmetic ...

Arithmetic - Wikipedia, the free encyclopedia
... numbers , especially the properties of the traditional operations between them — addition , subtraction , multiplication and division . Arithmetic ...

Mental Arithmetic - train your brain! on the App Store on iTunes
Get Mental Arithmetic - train your brain! on the App Store. See screenshots and ratings, and read customer reviews.

Arithmetic Puzzle - Haskell live coding - YouTube
Live coding of Ruby Quiz 7 - Arithmetic Puzzle "Countdown" Unscripted, unedited, (uncut) - Haskell Uncut Read more at my blog post: http://c ...

Australia's deadliest sniper, Ian Robertson, 'never did the arithmetic'
The deadliest man in Australia comes from Melbourne, but he is not a gangster or a hitman. He is more a foxtrotting man, these days. He can do ...

Genetic anomaly could explain severe difficulty with arithmetic - The Science Show - ABC Radio National ...
... is that numbers are wired into the human brain and perhaps a genetic anomaly explains why some children have severe difficulties with arithmetic. ...

Help your kids master arithmetic with Monster Math 2
... upgrade to Monster Math 2 Pro and get access to new worlds, more advanced reporting, and all of the math skills. Help your kids master arithmetic ...

Price Drop: MencalHD:Mental Arithmetic Training,Improve Your Skills In Math
MencalHD:Mental Arithmetic Training,Improve Your Skills In Math 1.0 Device: iOS iPad Only Category: Education Price: Free, Version: 1.0 ( iTunes ...

Analysis: Republicans' budget plans require creative arithmetic to add up
Pittsburgh Post-Gazette Analysis: Republicans' budget plans require creative arithmetic to add up Bellingham Herald WASHINGTON — Republicans ...

"Here's America today... frivolous entertainment, texting and Twitter replacing serious news reporting ...
If only we weren't so frivolous , if we could get serious , maybe we could figure it all out.

Resources last updated: 1/2/2016 8:10:24 PM