Hi, I've developed a simple scheduled task that executes a Stored procedure. When I run the task in debug mode the application writes out the following error message: "17/01/2011 10:11:36,modFunctions,GetData,5,INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods."
BUT if i execute the Sp from within SQL itself it runs no problems. Here's the SQL code:
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 ARITHABORT ON
BEGIN
INSERT INTO mp_whsStockWatchMTS2BKUP
SELECT MAX(Category1) AS Category1,
Region,
Site,
Area,
MAX(Category2) AS Category2,
MAX(COALESCE(Category3, 'NULL')) AS Category3,
MAX(COALESCE(Category7, 'NULL')) AS Category7,
Resource,
MAX(COALESCE(Description, 'NULL')) 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
Any ideas why the app can't execute the SP?