You can turn ARITHABORT on/off with SET ARITHABORT ON;
and SET ARITHABORT OFF;
.
However, there is seldom a need to explicitly change the ARITHABORT session setting. ARITHABORT is implicitly ON when connecting to a database in SQL 2005 or later compatibility level when ANSI_WARNINGS is also ON. Modern SQL Server client APIs connect with ANSI_WARNINGS ON so ARITHABORT is implicitly ON and will remain so unless explicitly overridden with SET ARITHABORT OFF;
. This is called out the the documentation:
When ANSI_WARNINGS has a value of ON and the database compatibility level is set to 90 or higher then ARITHABORT is implicitly ON regardless of it's value setting. If the database compatibility level is set to 80 or earlier, the ARITHABORT option must be explicitly set to ON.
The ARITHABORT ON setting (implicit or explicit) is required to use features like filtered indexes, indexed views. etc. One had to explicitly turn on ARITHABORT back in the SQL 2000 days (or set it as the default setting via sp_configure 'user options'). Now that it's controlled by the database compatibility level, the implication is it will be on as long as one is using a supported SQL Server version (SQL 2012 or later, including Azure SQL Database) and an API that sets ANSI_WARNINGS ON.
Erland added that SSMS explicitly sets ARITHABORT ON even though it's already implicitly ON with a SQL 2005+ compatibility level database. Although the ARITHABORT behavior will be the same regardless of whether it's set explicitly or implicitly, the gotcha is the setting is also part of the cache key. This can result in multiple cached plans (which may be different) for the same proc or query due to the implicit versus explict setting.