Divide by zero error on SQL Server 2005 (SET ARITHIGNORE ON)

Posted on 2007-08-08
Last Modified: 2011-10-03
sql server 2005 BOL states that you can specify ARITHIGNORE ON to ignore div by zero errors.

See example in:

This setting however seems to make no difference, and SQL server will abort with an error.

Anyone else come across this/ideas?

Question by:CMGL
    LVL 39

    Accepted Solution

    in tha same page if you read it fine it says(in remarks section)

    If either SET ARITHABORT or SET ARITHIGNORE is OFF and SET ANSI_WARNINGS is ON, SQL Server still returns an error message when encountering divide-by-zero or overflow errors.

    so you need to set
    LVL 39

    Expert Comment

    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    u can use eception handling if you are using sql 2005

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now