SQL Query Again - Complex

  • How to i tackle Divide by Zero errors.

    Since sometimes my value of @Share is Zero.

    And I get a Divide By Zero error that affects by SQL query. How do i tackle this?

  • You can handle the divide-by-zero exceptions by using SET ARITHABORT ON/OFF switches. For more help, u can refer BOL. All the best

  • I have done this...Is this right..

    SET ARITHABORT OFF

    SET ARITHIGNORE ON

    SET ANSI_WARNINGS OFF

  • Raj, you can do these settings and prevent the QA from showing you the exception messages, but the recommended approach would be to check the variable in tsql and then perform the divide operations...

    i mean something like what sushila has put above e.g. if(@Share > 0)

Viewing 4 posts - 76 through 78 (of 78 total)

You must be logged in to reply to this topic. Login to reply