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 Wednesday, February 1, 2012 8:56 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 2:13 PM
Points: 31,040, Visits: 15,472
Comments posted to this topic are about the item INSERT OUTPUT






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1245442
Posted Wednesday, February 1, 2012 8:57 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 18, 2014 7:50 PM
Points: 5,322, Visits: 25,235
Going back to the basics - Nice question

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1245443
Posted Wednesday, February 1, 2012 11:24 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 11:59 PM
Points: 1,885, Visits: 574
Nice Question.

-----------------
Gobikannan
Post #1245470
Posted Wednesday, February 1, 2012 11:41 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, September 18, 2014 10:01 PM
Points: 1,287, Visits: 1,122
Good Question !!!.
Post #1245478
Posted Wednesday, February 1, 2012 11:58 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:29 PM
Points: 12,966, Visits: 10,742
Great question. I was looking for a trap, but apparently there wasn't any



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1245483
Posted Thursday, February 2, 2012 12:27 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 10:07 AM
Points: 9,923, Visits: 11,170
Koen Verbeeck (2/1/2012)
Great question. I was looking for a trap, but apparently there wasn't any

Me too. I was expecting:

GO
CREATE TABLE dbo.Test
(
ID integer IDENTITY PRIMARY KEY,
AuditDateTime datetime NOT NULL
);
GO
CREATE TRIGGER [trg dbo.Test IOI AuditDateTime]
ON dbo.Test
INSTEAD OF INSERT
AS
BEGIN
SET ROWCOUNT 0;
SET NOCOUNT ON;

INSERT dbo.Test
(AuditDateTime)
SELECT
GETUTCDATE()
FROM INSERTED AS ins
END;

DECLARE @Output TABLE (ID integer, AuditDateTime datetime);

INSERT dbo.Test
OUTPUT INSERTED.*
INTO @Output
DEFAULT VALUES;

-- Zero and NULL!
SELECT * FROM @Output AS o;
GO
DROP TABLE Test;





Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #1245498
Posted Thursday, February 2, 2012 12:58 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 @ 8:45 AM
Points: 3,969, Visits: 5,212
Good, simple, back-to-basics question.
Thanks, Steve


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1245513
Posted Thursday, February 2, 2012 2:13 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, July 9, 2013 11:12 PM
Points: 1,263, Visits: 1,081
Thanks for a nice and easy question.
Sometimes it pays to "process" the newsletter from top to bottom, as there was an informative post by one Steve Jones .

Cheers,
Michael
Post #1245545
Posted Thursday, February 2, 2012 2:14 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 3:25 AM
Points: 373, Visits: 665
DATE is not a valid data type... ?

Ben

^ Thats me!


----------------------------------------
01010111011010000110000101110100 01100001 0110001101101111011011010111000001101100011001010111010001100101 01110100011010010110110101100101 011101110110000101110011011101000110010101110010
----------------------------------------
Post #1245546
Posted Thursday, February 2, 2012 2:25 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:15 AM
Points: 2,372, Visits: 7,562
BenWard (2/2/2012)
DATE is not a valid data type... ?


It was introduced for SQL Server 2008, so I guess the question should read "On SQL Server 2008 and above, what is the output of this code?"



Not a DBA, just trying to learn

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better, quicker answers on SQL Server performance related questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/



If you litter your database queries with nolock query hints, are you aware of the side effects?
Try reading a few of these links...

(*) Missing rows with nolock
(*) Allocation order scans with nolock
(*) Consistency issues with nolock
(*) Transient Corruption Errors in SQL Server error log caused by nolock
(*) Dirty reads, read errors, reading rows twice and missing rows with nolock


LinkedIn | Blog coming soon (for sufficiently large values of "soon" )!
Post #1245558
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse