set ARITHABORT on

  • Thread starter Thread starter fniles
  • Start date Start date
F

fniles

I have a SQL 2000 database that I just reindex a table.
After I do that, in my program before I can delete/insert I need to "set
ARITHABORT on", otherwise I get an error.
Also, a select statement without it runs very slow.
Why after I re-index a table I need to "set ARITHABORT on" in my program ?
How can I set it so that I don't have to do "set ARITHABORT on" in my
program ?

Thank you

Using Command = New SqlCommand("SET ARITHABORT ON", connection)
Command.CommandType = CommandType.Text
Command.ExecuteNonQuery()
End Using
 
Hi
Dim cmd As adodb.Command

Set cmd = New adodb.Command
With cmd
Set .ActiveConnection = cnn
.CommandType = adodb.CommandTypeEnum.adCmdText
.CommandText = "set arithabort on"
Call .Execute
End With
Set cmd = Nothing
 
Thank you, everyone.

My question is, why before I reindex the table, I didn't need to add the
"set ARITHABORT on" in my program, but after re-indexing the table, I need
to do that, otherwise I either get an error on insert/update or the query
runs slow on a select statement ?
 
My question is, why before I reindex the table, I didn't need to add the
"set ARITHABORT on" in my program, but after re-indexing the table, I need
to do that, otherwise I either get an error on insert/update or the query
runs slow on a select statement ?

ARITHABORT ON is required on connections that update tables with indexes on
computed columns or indexed views. I suggest you change the database
default as Uri suggested so that you don't need to change the app code or
procs.

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
 
Back
Top