SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The OUTPUT clause


The OUTPUT clause

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
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.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)

Group: General Forum Members
Points: 816158 Visits: 46249
Gosh... I'd NEVER (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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
Depends on what you're auditing, but point taken.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Kenneth Fisher
Kenneth Fisher
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17090 Visits: 2172
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 Fisher
I 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/For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/Link to my Blog Post --> www.SQLStudies.com
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
That would be good. Anything that showcases how to use this. We're lacking some practical articles on this topic.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
ALAN.H.HYNEMAN
ALAN.H.HYNEMAN
Old Hand
Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)

Group: General Forum Members
Points: 330 Visits: 127
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
TheJimmy
TheJimmy
Old Hand
Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)

Group: General Forum Members
Points: 339 Visits: 107
I will write an article on using OUTPUT with a MERGE statement if it is still required.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
Please feel free and submit in the contribution center (click "Write for us" to the left).

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Amarendra Reddy Thummeti
Amarendra Reddy Thummeti
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1110 Visits: 125
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
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
we could use another one, so please feel free.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Amarendra Reddy Thummeti
Amarendra Reddy Thummeti
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1110 Visits: 125
OK will try to send it out ASAP.

Thanks,
AMAR
amarreddy23@gmail.com
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
No hurry

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Amarendra Reddy Thummeti
Amarendra Reddy Thummeti
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1110 Visits: 125
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
Amarendra Reddy Thummeti
Amarendra Reddy Thummeti
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1110 Visits: 125
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
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
Thanks, I'll take a look as soon as I can

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Amarendra Reddy Thummeti
Amarendra Reddy Thummeti
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1110 Visits: 125
Steve,
I submitted a good one on the last one output clause for MERGE statements as well.
Will be waiting for your feedback.

Thanks,
AMAR
amarreddy23@gmail.com
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
We'll get to it. It can take a week or so to get through articles, depending on how many submissions we get.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
jbieber
jbieber
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 272
Are you still looking for articles on this?
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562186 Visits: 20825
I think we're good. I'll close this for now.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search