December 9, 2013 at 6:39 am
We have an insert statement crashing about 20,000 records into the insert because of an Arithmetic overflow error converting numeric to data type numeric . How can we determine the row it is stopping on?
The insert statement is similar to:
INSERT INTO Employees2
SELECT
[LastName]
,[FirstName]
,[Title]
,[TitleOfCourtesy]
,[BirthDate]
,[HireDate]
,[Address]
,[City]
,[Region]
,[PostalCode]
,[Country]
,[HomePhone]
,[Extension]
,[Photo]
,[Notes]
,[ReportsTo]
,[PhotoPath] from Employees
thanks
December 9, 2013 at 6:50 am
Hi, the data that you are inserting are coming from a query, I suppose, then you can check in the select clause, running it separately, for the aforementioned overflow error. Otherwise you can try to put the data in order and check around the 20000 row...
Let me know!
December 9, 2013 at 7:21 am
The actual data is coming from an ODBC link using and OPENROWSET. I will try an order By clause the next time we run it later this week.
We have narrowed it down to about 300 records using a where clause. The table structure has about 30 smallint columns and I am guessing it is one of those columns that is throwing the error.
Thanks
December 9, 2013 at 7:45 am
What are the definitions of the two tables?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 9, 2013 at 2:21 pm
I found this article that may help you out.
Kurt W. Zimmerman
SR DBA
Lefrak Organization
New York, NY
http://www.linkedin.com/in/kurtwzimmerman
December 10, 2013 at 6:15 am
SET NUMERIC_ROUNDABORT looks like a plan. We will try it tonight.
Thanks
December 13, 2013 at 6:32 am
I tried SET NUMERIC_ROUNDABORT,but I still got the arithmetic error. We finally determined that we were pushing [numeric](7, 2) into a [numeric](6, 2). Once we corrected the column it ran.
Thanks,
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply