• josh shilling (5/21/2010)


    Try flipping the

    (Field LIKE @Param OR @Param IS NULL)

    To

    (@Param IS NULL OR FIELD Like @Param)

    See this post by Mark Cohen...

    http://beingmarkcohen.com/?p=62

    That page contains quite questionable statements. It's a shame it still comes in the first Google page for "sql short-circuit".

    I'll try to finish soon my article on short-circuiting and (hopefully) get it published here.

    -- Gianluca Sartori