Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Changing the Arithmetic Abort Enabled property

Author  Topic 

eljapo4
Posting Yak Master

100 Posts

Posted - 2011-01-27 : 07:28:48
Hi, I changed this property from true to false on a database so that the DB would allow a .net application that I have developed to execute a stored procedure. But the DBA requested that I change the property setting back to TRUE as this effects our ERP system's behaviour. Canany of you explain what the effects the Arithmetic Abort Enabled property have on how a DB acts are?

Ifor
Aged Yak Warrior

700 Posts

Posted - 2011-01-27 : 08:30:41
You could SET ARITHABORT OFF in your sp but I suspect this would be a VERY BAD idea.

You should really work out what is causing the overflow or divide-by-zero error in the SP and handle it according to the business rules.

Ignoring a divide-by-zero error can loose a company a lot of money and does not result in a good reference!
Go to Top of Page

eljapo4
Posting Yak Master

100 Posts

Posted - 2011-01-27 : 09:16:56
It's a good job I only made that change on a test DB then! If i run the SQL from within SSMS the SP executes perfectly, but the plan was to create a windows scheduled task and schedlue that to run every Sat night.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/*

EXEC mp_whsStockWatch_viewsWTableMTS2BKUP
# Updated: 22/12/2010 - Because mp_whsStockWatchMTS2BKUP has a computed coulmn added I've had to add SET ARITHABORT ON
*/

ALTER PROCEDURE [dbo].[mp_whsStockWatch_viewsWTableMTS2BKUP]

AS
--SET NOCOUNT ON
SET ARITHABORT ON
--GO

BEGIN

INSERT INTO mp_whsStockWatchMTS2BKUP
SELECT MAX(Category1) AS Category1,
Region,
Site,
Area,
MAX(Category2) AS Category2,
MAX(COALESCE(Category3, 'NULL')) AS Category3,
--MAX(Category3) AS Category3,
MAX(COALESCE(Category7, 'NULL')) AS Category7,
--MAX(Category7) AS Category7,
Resource,
MAX(COALESCE(Description, 'NULL')) AS Description,
--MAX(Description) AS Description,
SUM(Quantity) AS Quantity,
MAX(UM) AS UM,
SUM(EURValue) AS EURValue,
SUM(GBPValue) AS GBPValue,
MAX(Price) AS Price,
MAX(Currency) AS Currency,
QAStatus,
Days,
CAST(CONVERT(DATETIME,GETDATE(),105) AS VARCHAR(35)) AS CurrDate,
Age
FROM mp_whsStockWatchVw1
GROUP BY Region,
Site,
Area,
Resource,
UM,
QAStatus,
Days,
Age
ORDER BY Category1

END

GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

as you can see the code is only selecting data from one table and backing it up in another so i don't understand why there would be any overflow or divide-by-zero errors happening
Go to Top of Page

Ifor
Aged Yak Warrior

700 Posts

Posted - 2011-01-27 : 10:20:15
The datatypes may not be large enough to hold the SUM of the values.

Loosing these SUMs may be a problem.
Go to Top of Page
   

- Advertisement -