ARITHABORT problem



I'm running D7 and MS SQL 2000. I have a calculated indexed column that is
causing me some problems. When I run a stored procedure from my application
that inserts new rows into the table, I get an ARITHABORT error. When I run
the same stored procedure from the MS SQL QA it works fine. Apparently
that's because QA has ARITHABORT turned ON by default where that's not the
case when calling the procedure from the client application. My question is
does anyone know how I can turn it on just before executing the stored
procedure? Here's what I'm doing below. The detials are not really important
because all of t he below works just fine if I remove the index on the
calculated column in the backend. The error occurs of course when the
procedure executes. I need to know what to do just before the ExecProc line
to turn ARITHABORT on. Does anyone know how to do that?

stprAddNewTrans := TADOStoredProc.Create(nil);
with stprAddNewTrans do
try
Connection := dmMyDataMod.cnnMyConnection;
ProcedureName := 'spAddNewOrUpdateTrans';

with Parameters do
begin
Refresh;

ParamByName('@sUserName').Value := sLoggedInUsersName;
ParamByName('@iBankAcctID').Value := lkCboXferFromBankAcct.EditValue;
ParamByName('@sTransDate').Value := FormatDateTime('mm/dd/yyyy',
dteCboXferDate.EditValue);
ParamByName('@sCheckNum').Value := 'XFR';
ParamByName('@sPayee').Value := 'Transfer from ' +
Trim(lkCboXferFromBankAcct.EditingText) + ' to ' +
Trim(lkCboXferToBankAcct.EditingText);
ParamByName('@mDebitAmt').Value := mskTxtXferAmt.EditValue;
ParamByName('@mCreditAmt').Value := null;
ParamByName('@sTransMemo').Value := '';
ParamByName('@sTransCat').Value := '';
ParamByName('@iXferBankAcctID').Value :=
lkCboXferToBankAcct.EditValue;
ParamByName('@sTempIDField').Value := CreateClassID;
ParamByName('@iNewTransID').Value := 0;
end;
Prepared := True;

ExecProc; // <<<<<<<< ERROR OCCURS HERE

(* If successfull then sRetStatus is <> 0 *)
iNewTransID := Parameters.ParamByName('@iNewTransID').Value;

Prepared := False;

finally
Free;
end;

Thanks,

Keith


.



Relevant Pages

  • Re: Views vs Stored Procedures, whats the difference?
    ... I hope you are not suggesting you embed SQL queries into the application? ... A stored procedure logic will be exactly as fast as the algorithm you ... I understant that SQL Server supports hints. ... implementations (nestedloop, merge, hash, ..) on decent sized tables, then ...
    (comp.databases.ms-sqlserver)
  • Re: Stored Procedures - Patterns and Practices
    ... >published the reasoning behind its opinions. ... I disagree that the debate in SQL Server related discussion forums ... If the natural key is long or spans too many ... I want to call a stored procedure that adds a customer ...
    (microsoft.public.sqlserver.programming)
  • Re: Issue with retrieving large data over web using Stored Procedu
    ... how do I go about analyzing a stored procedure with selecting ... Is there any tool in the SQL Profiler that analyze each Trace? ... "Active Server Pages error 'ASP 0113' ... This email account is my spam trap ...
    (microsoft.public.inetserver.asp.db)
  • Re: Problem using SP as record source with Access2002 & SQL Server 7
    ... I've installed a brand new copy of SQL Server 2000 with the original ... I've created the folowing stored procedure for the resync ... Resync Command: ALL_CUSTOMERS_RESYNC? ... I need to upgrade to a newer version of Microsoft SQL ...
    (microsoft.public.access.adp.sqlserver)
  • Re: using Command to set Parameters and Recordset to retrive the Query
    ... doesn't the rsData will be interpretate as an input parameter in the SP? ... >> Query and retrive the Recordset so I can use the Paging property ... > Even if this technique of using the parameters in the ORDER BY does work for> you, I suspect that this will defeat your objective of preventing sql> injection. ... See below for a more efficient solution> using a stored procedure. ...
    (microsoft.public.inetserver.asp.general)