Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

The OUTPUT clause and T-SQL Syntax Expand / Collapse
Author
Message
Posted Wednesday, July 24, 2013 5:58 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, May 11, 2016 1:17 AM
Points: 282, Visits: 100
Good and tough question :)
Post #1477015
Posted Wednesday, July 24, 2013 11:14 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 10:06 AM
Points: 5,446, Visits: 4,621
This was an interesting one - thanks, Pramod!
Post #1477177
Posted Thursday, July 25, 2013 2:57 PM


SSC-Insane

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

Group: General Forum Members
Last Login: Yesterday @ 2:52 PM
Points: 20,083, Visits: 18,257
Lokesh Vij (7/22/2013)
Good Question Pramod. But explanation could have been refined.


+2




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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1477753
Posted Thursday, August 1, 2013 8:21 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Saturday, September 17, 2016 8:27 PM
Points: 258, Visits: 556
Sorry, seems something not clear in this question, in the Question (select 4) what it means
i am choosing 2 3 5 it say i am wrong
if object_id('test2') is not null
drop table test2
if object_id('test1') is not null
drop table test1

create table test1 (a int not null primary key);
create table test2 (b int,a int )
GO

--statement 1
insert into test1
output inserted.a
select 1
GO

--statement 2
create trigger trig_test1
on test1 after insert
as
select 2
GO

--statement 3
insert into test1
select 3
GO

--statement 4
insert into test1
output inserted.a
select 4
GO

--statement 5
declare @temp as table (b int)

insert into test1
output inserted.a
into @temp
select 5

select * from @temp
GO

So what is statement 1




Every rule in a world of bits and bytes, can be bend or eventually be broken
MyBlog About Common dialog control
A Visualizer for viewing SqlCommand object script
Post #1479964
Posted Friday, August 2, 2013 1:44 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: Monday, May 23, 2016 5:31 AM
Points: 3,615, Visits: 2,774
Good QOTD. And some good clarification by Hugo (as always).
Post #1480286
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse