very simple update statement question

  • never mind - found a trigger to cause this issue.

  • henrik.bernhard (5/4/2010)


    never mind - found a trigger to cause this issue.

    In the future, please don't delete your original post just because you found a fix. Someone might be able to learn from it... especially if you're generous enough to post what the fix is.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I'll keep that in mind for next time.

    Basically it was an update statement where if I would update a value to a varchar column with a 3 digit number enclosed in single quotes it would never finish, but without the single quotes it would run in a sec

    as such

    --doesn't run

    UPDATE depdir

    SET branchid = '004'

    WHERE org1 = '7'

    -- runs in a sec

    UPDATE depdir

    SET branchid = 004

    WHERE org1 = '7'

    a minute after i posted i checked if there was any triggers on the table - and sure enough, once disabled both would run. Didn't really investigate why the triggers would not accept a varchar value insertion into the varchar column, but would take the int and convert it into the varchar column without blinking (if i understood the with/without singlequotes correct)

    Thats all forwarded to the devs of the app now for them to chew on now 🙂

  • Very cool of you to comeback, Henrik. Thank you much and thanks for taking the time to "repost" your problem. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

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