The OUTPUT clause

  • Looking for a couple articles here. One on basics of OUTPUT for inserts and deletes. One for updates and combining inserted and deleted tables. Auditing is the obvious case, but anything else is OK.

    A third one on MERGE would be good as well.

  • Gosh... I'd [font="Arial Black"]NEVER [/font](and I don't say that word often) use the OUTPUT clause for auditing. That would make auditing code dependent instead of just happening for any change to the table being audited.

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

  • Depends on what you're auditing, but point taken.

  • I did a blog post a few years back on using OUTPUT to backup table changes. I could do an updated version?

    Kenneth Fisher

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • That would be good. Anything that showcases how to use this. We're lacking some practical articles on this topic.

  • For even more fun why not output into a memory optimized udt and do some additional processing with it, get some metrics around performance differences between outputting to temp vs output to memory.

    Alan Hyneman

  • I will write an article on using OUTPUT with a MERGE statement if it is still required.

  • Please feel free and submit in the contribution center (click "Write for us" to the left).

  • Steve,
    I have few examples which can explain this , can i work on this article or did u already got some one submitted it?

    Thanks,
    AMAR
    amarreddy23@gmail.com

  • we could use another one, so please feel free.

  • OK will try to send it out ASAP.

    Thanks,
    AMAR
    amarreddy23@gmail.com

  • No hurry

  • Steve,
    I have submitted one article today for Insert and Deletes with The OUTPUT Clause for INSERT & DELETE Statements title.

    I will be working on next two, 
    updates and combining inserted and deleted tables and one on MERGE

    Thanks,
    AMAR
    amarreddy23@gmail.com

  • Steve,
    I Submitted the 2nd one with The OUTPUT Clause for UPDATE Statements. i followed the similar format as the 1st one . i will be working on the MERGE now.

    Thanks,
    AMAR
    amarreddy23@gmail.com

  • Thanks, I'll take a look as soon as I can

Viewing 15 posts - 1 through 15 (of 18 total)

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