• Looks like the key insight is in http://www.sqlservercentral.com/articles/SSRS/119024/ "Dealing with the Evil of FMTONLY from SSRS": every possible conditional code branch is evaluated. Yes, that is right: every IF / ELSE branch.

    So it really does not matter what we test, as long as it is something that normally would not be true:

    SET FMTONLY ON

    IF 1 = 0 BEGIN

    SET FMTONLY OFF

    PRINT 'was on'

    END

    Although he recommends checking that @@OPTIONS = NULL.