• CELKO (12/14/2012)


    .. Total failure.. Besides which, I believe my earlier post was the same idea, except coded correctly 🙂 .

    Yeah, it was awful! :crazy:

    What I wanted to do was avoid the CASE expression solution and go for something using functions that compile to simple assembly language.

    DELETE FROM Client_Shares

    WHERE COALESCE (SIGN(ABS(lm_id)+1), 0)

    + COALESCE (SIGN(ABS(ml_id) +1), 0)

    + COALESCE (SIGN(ABS(is_id) +1), 0)

    + COALESCE (SIGN(ABS(t_id)+1), 0) >= 2;

    Yiikes, that's incredibly convoluted. What a royal pita to try to understand, much less change or debug later!!

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.