Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

INSERT OUTPUT Expand / Collapse
Author
Message
Posted Thursday, February 2, 2012 2:27 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, September 20, 2012 7:17 AM
Points: 11, Visits: 25
good one.
Post #1245561
Posted Thursday, February 2, 2012 2:28 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 2:53 AM
Points: 373, Visits: 662
Ah cool. As expected it worked fine on 2k5 when I set the data type to DATETIME

Looks like a really useful funtion. I shall be using it a lot I'm sure!


Ben

^ Thats me!


----------------------------------------
01010111011010000110000101110100 01100001 0110001101101111011011010111000001101100011001010111010001100101 01110100011010010110110101100101 011101110110000101110011011101000110010101110010
----------------------------------------
Post #1245564
Posted Thursday, February 2, 2012 3:22 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 24, 2013 9:59 PM
Points: 1,354, Visits: 1,299
I like using this function for audit tables. If you have an application that allows users to add, edit, and delete, you can use this method to keep track of the changes performed by those users. Nice if you are asked to provide information such as who updated the record and what was changed.
Post #1245594
Posted Thursday, February 2, 2012 4:30 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 29, 2014 11:20 AM
Points: 1,945, Visits: 3,204
Cheers Steve, I was looking for the trap too!

I love this feature, actually currently writing lots of them for a data migration project.
Post #1245625
Posted Thursday, February 2, 2012 4:43 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:32 AM
Points: 3,068, Visits: 3,247
Simple question - thanks.
No trap - thanks.
Points today - thanks


-------------------------------
Posting Data Etiquette - Jeff Moden
Smart way to ask a question

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
Post #1245637
Posted Thursday, February 2, 2012 5:15 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:38 AM
Points: 1,755, Visits: 477
Nice simple basis question - Thanks! I did have to double check looking for the trick though!!!
Post #1245660
Posted Thursday, February 2, 2012 5:25 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 8:26 AM
Points: 1,803, Visits: 2,168
Stuart Davies (2/2/2012)
Simple question - thanks.
No trap - thanks.
Points today - thanks


I agree, and am also concise and grateful.


Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Post #1245671
Posted Thursday, February 2, 2012 6:06 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
Thanks Steve



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1245713
Posted Thursday, February 2, 2012 6:22 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, August 25, 2014 5:20 AM
Points: 1,775, Visits: 362
Good question about a very useful feature that a lot of people do not appear to know about. You can also use the OUTPUT clause with the MERGE command too. It's especially useful when you need to know a range of values that were inserted so that you have the newly generated keys in order to also insert data into detail tables below the insert.
Post #1245730
Posted Thursday, February 2, 2012 6:36 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 1:36 PM
Points: 1,664, Visits: 1,093
Hand up, I did not know about it. I can definitely see uses for this OUTPUT thingy though - cheers.
Post #1245736
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse