Using UPDATE()

  • Comments posted to this topic are about the item Using UPDATE()

  • Nice question to end the week on, thanks, Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    β€œlibera tute vulgaris ex”

  • got it wrong but learnt something new,
    cheers Steve

    ---------------------------------------------------------------------------------------
    The more you know, the more you know that you dont know

  • Heh... this will make a good, quick ice-breaker question for interviews like the "How do you get the current date and time in T-SQL".  Litmus strips anyone? πŸ˜€

    --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)

  • Jeff Moden - Friday, August 17, 2018 7:42 AM

    Heh... this will make a good, quick ice-breaker question for interviews like the "How do you get the current date and time in T-SQL".  Litmus strips anyone? πŸ˜€

    Well, the real answer is of course "only in some kinds of trigger".  The UPDATE() function can't be used in DDL triggers, or in Logon triggers, or in INSERT triggers - only in DELETE and UPDATE (DML) triggers - so there are more kinds of trigger that it can't be used in than kinds that it can be used in.

    Tom

  • TomThomson - Friday, August 17, 2018 8:11 AM

    Jeff Moden - Friday, August 17, 2018 7:42 AM

    Heh... this will make a good, quick ice-breaker question for interviews like the "How do you get the current date and time in T-SQL".  Litmus strips anyone? πŸ˜€

    Well, the real answer is of course "only in some kinds of trigger".  The UPDATE() function can't be used in DDL triggers, or in Logon triggers, or in INSERT triggers - only in DELETE and UPDATE (DML) triggers - so there are more kinds of trigger that it can't be used in than kinds that it can be used in.

    True enough but I'm shooting really low here... There have been many resumes I've been through where the candidate claims that they've written triggers but then can't tell me a thing about what the INSERTED or DELETED logical tables actually are.  Asking about UPDATE() is a nice short question that will allow me to quickly determine how full the candidate's ditty bag might actually be... or not. πŸ˜€  Again, "Litmus Strip".  If they know their stuff, I would expect them to follow up with a bit more information like what you just said.

    --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)

  • Jeff Moden - Friday, August 17, 2018 7:42 AM

    Heh... this will make a good, quick ice-breaker question for interviews like the "How do you get the current date and time in T-SQL".  Litmus strips anyone? πŸ˜€

    For sure

  • Nice question for a Friday.  Thanks Steve.

Viewing 8 posts - 1 through 7 (of 7 total)

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