Multiple choice sql

What will be the output of the following statement? SET ARITHABORT OFF SET ANSI_WARNINGS OFF SELECT 100/0

  1. Null

  2. 0

  3. Infinity

  4. An error is generated.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

With ARITHABORT OFF and ANSI_WARNINGS OFF, SQL Server returns NULL for division by zero instead of raising an error. ARITHABORT controls query termination on arithmetic errors, while ANSI_WARNINGS controls NULL/division-by-zero behavior. When both are OFF, the result is NULL rather than an error or infinity.

AI explanation

In SQL Server, dividing by zero normally raises error 8134 ('Divide by zero error encountered'). But when ANSI_WARNINGS is OFF (and ARITHABORT is OFF), SQL Server suppresses that error and instead returns NULL for the division-by-zero result — this is documented ANSI_WARNINGS OFF behavior. So SELECT 100/0 under these settings yields NULL, not 0, not an error, and not 'Infinity' (SQL Server has no floating-point infinity concept for integer division).