<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Tips from the SQL Joes 2 Pros Development Series &#8211; Output Clause in Simple Examples &#8211; Day 14 of 35</title>
	<atom:link href="http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: maclaure</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-327145</link>
		<dc:creator><![CDATA[maclaure]]></dc:creator>
		<pubDate>Wed, 08 Aug 2012 14:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-327145</guid>
		<description><![CDATA[1) UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Updated.Hourly as  NewPay WHERE Hourly IS NOT NULL;

*** WRONG: Because there is no &#039;Updated&#039; virtual table.

2) UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Updated.Hourly as OldPay, Deleted.Hourly as NewPay WHERE Hourly IS NOT NULL;

*** WRONG: Because there is no &#039;Updated&#039; virtual table.

3) UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay WHERE Hourly IS NOT NULL;

*** WRONG: Because Deleted.Hourly Should be the OLD value not NEW value.

4) UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay WHERE Hourly IS NOT NULL;

**** CORRECT answer.]]></description>
		<content:encoded><![CDATA[<p>1) UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Updated.Hourly as  NewPay WHERE Hourly IS NOT NULL;</p>
<p>*** WRONG: Because there is no &#8216;Updated&#8217; virtual table.</p>
<p>2) UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Updated.Hourly as OldPay, Deleted.Hourly as NewPay WHERE Hourly IS NOT NULL;</p>
<p>*** WRONG: Because there is no &#8216;Updated&#8217; virtual table.</p>
<p>3) UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay WHERE Hourly IS NOT NULL;</p>
<p>*** WRONG: Because Deleted.Hourly Should be the OLD value not NEW value.</p>
<p>4) UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay WHERE Hourly IS NOT NULL;</p>
<p>**** CORRECT answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maclaure</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-327141</link>
		<dc:creator><![CDATA[maclaure]]></dc:creator>
		<pubDate>Wed, 08 Aug 2012 14:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-327141</guid>
		<description><![CDATA[1) UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Updated.Hourly as NewPay
    WHERE Hourly IS NOT NULL
    UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Updated.Hourly as OldPay, Deleted.Hourly as NewPay
    WHERE Hourly IS NOT NULL
    UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay
    WHERE Hourly IS NOT NULL
    UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
    WHERE Hourly IS NOT NULL]]></description>
		<content:encoded><![CDATA[<p>1) UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Updated.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL<br />
    UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Updated.Hourly as OldPay, Deleted.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL<br />
    UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL<br />
    UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Identity Fields &#8211; Contest Win Joes 2 Pros Combo (USD 198) &#8211; Day 2 of 5 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-326219</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Identity Fields &#8211; Contest Win Joes 2 Pros Combo (USD 198) &#8211; Day 2 of 5 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Tue, 07 Aug 2012 01:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-326219</guid>
		<description><![CDATA[[...] SQL Joes 2 Pros Development Series – Output Clause in Simple Examples [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL Joes 2 Pros Development Series – Output Clause in Simple Examples [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; A Quick Look at Logging and Ideas around Logging &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-300136</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; A Quick Look at Logging and Ideas around Logging &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Tue, 12 Jun 2012 01:31:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-300136</guid>
		<description><![CDATA[[...] Tips from the SQL Joes 2 Pros Development Series – Output Clause in Simple Examples [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Tips from the SQL Joes 2 Pros Development Series – Output Clause in Simple Examples [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavithra</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-165929</link>
		<dc:creator><![CDATA[Pavithra]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 09:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-165929</guid>
		<description><![CDATA[UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

cause update use two temporary table inserted and Deleted . In deleted it store old data and in inserted it store the new data .]]></description>
		<content:encoded><![CDATA[<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>cause update use two temporary table inserted and Deleted . In deleted it store old data and in inserted it store the new data .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghav</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-161967</link>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 21:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-161967</guid>
		<description><![CDATA[Very Very nice article. Thanks a lot]]></description>
		<content:encoded><![CDATA[<p>Very Very nice article. Thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – SQL Query Techniques For Microsoft SQL Server 2008 – Book Available for SQL Server Certification Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-160392</link>
		<dc:creator><![CDATA[SQL SERVER – SQL Query Techniques For Microsoft SQL Server 2008 – Book Available for SQL Server Certification Journey to SQLAuthority]]></dc:creator>
		<pubDate>Mon, 22 Aug 2011 01:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-160392</guid>
		<description><![CDATA[[...] Q 14) SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – Output Clause in Simple Examples... [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Q 14) SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – Output Clause in Simple Examples&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-159794</link>
		<dc:creator><![CDATA[Ramesh]]></dc:creator>
		<pubDate>Sat, 20 Aug 2011 07:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-159794</guid>
		<description><![CDATA[Option 4 is the correct answer.

4.UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL]]></description>
		<content:encoded><![CDATA[<p>Option 4 is the correct answer.</p>
<p>4.UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uday Kumar B R</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-158682</link>
		<dc:creator><![CDATA[Uday Kumar B R]]></dc:creator>
		<pubDate>Thu, 18 Aug 2011 04:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-158682</guid>
		<description><![CDATA[Question 14

You have an HourlyPay table and are giving all hourly employees a $1 raise. When you run the update statement you want to see the EmpID, OldPay, and NewPay. What code will achieve this result?

Answer is 4.
    UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
    WHERE Hourly IS NOT NULL

following is also Correct But Alias names are Wrong 
3.  UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay
    WHERE Hourly IS NOT NULL

Following are Wrong
  1.  UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Updated.Hourly as NewPay
    WHERE Hourly IS NOT NULL
   
2. UPDATE HourlyPay SET Hourly = Hourly + 1
    OUTPUT Deleted.EmpID , Updated.Hourly as OldPay, Deleted.Hourly as NewPay
    WHERE Hourly IS NOT NULL]]></description>
		<content:encoded><![CDATA[<p>Question 14</p>
<p>You have an HourlyPay table and are giving all hourly employees a $1 raise. When you run the update statement you want to see the EmpID, OldPay, and NewPay. What code will achieve this result?</p>
<p>Answer is 4.<br />
    UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL</p>
<p>following is also Correct But Alias names are Wrong<br />
3.  UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL</p>
<p>Following are Wrong<br />
  1.  UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Updated.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL</p>
<p>2. UPDATE HourlyPay SET Hourly = Hourly + 1<br />
    OUTPUT Deleted.EmpID , Updated.Hourly as OldPay, Deleted.Hourly as NewPay<br />
    WHERE Hourly IS NOT NULL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abhIShek online4all</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-158442</link>
		<dc:creator><![CDATA[abhIShek online4all]]></dc:creator>
		<pubDate>Wed, 17 Aug 2011 15:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-158442</guid>
		<description><![CDATA[Hi Dave,
Can u clarify my doubt?

I want  to insert the output values into another #result table , how can it possible. 
or i want to assign the output values to a variable?

Please give me the query.

Example:

create table #tbl (id int identity(1,1) , name varchar(10) , dept varchar(10) )
insert into #tbl (name , dept ) 
 output inserted.*
 select &#039;abhIShek Online4All&#039; , &#039;d&#039;
/*----------------------------------------------------------
Result:
id  name                   dept
1	abhIShek Online4All  	d
----------------------------------------------------------
*/

----------------------------------------------------------
--i want to insert above result into #result table.
----------------------------------------------------------




Thanks in advance,

Regards,
abhIShek Online4all]]></description>
		<content:encoded><![CDATA[<p>Hi Dave,<br />
Can u clarify my doubt?</p>
<p>I want  to insert the output values into another #result table , how can it possible.<br />
or i want to assign the output values to a variable?</p>
<p>Please give me the query.</p>
<p>Example:</p>
<p>create table #tbl (id int identity(1,1) , name varchar(10) , dept varchar(10) )<br />
insert into #tbl (name , dept )<br />
 output inserted.*<br />
 select &#8216;abhIShek Online4All&#8217; , &#8216;d&#8217;<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Result:<br />
id  name                   dept<br />
1	abhIShek Online4All  	d<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
*/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8211;i want to insert above result into #result table.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Thanks in advance,</p>
<p>Regards,<br />
abhIShek Online4all</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azhar Iqbal</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-158175</link>
		<dc:creator><![CDATA[Azhar Iqbal]]></dc:creator>
		<pubDate>Wed, 17 Aug 2011 06:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-158175</guid>
		<description><![CDATA[Option 4 is Correct.
Pakistan.]]></description>
		<content:encoded><![CDATA[<p>Option 4 is Correct.<br />
Pakistan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikhil Mahajan</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-158063</link>
		<dc:creator><![CDATA[Nikhil Mahajan]]></dc:creator>
		<pubDate>Wed, 17 Aug 2011 03:06:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-158063</guid>
		<description><![CDATA[Option 4 is correct

4.UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

because deleted will give you old record and inserted will give you new record...


India]]></description>
		<content:encoded><![CDATA[<p>Option 4 is correct</p>
<p>4.UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>because deleted will give you old record and inserted will give you new record&#8230;</p>
<p>India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157806</link>
		<dc:creator><![CDATA[Eric]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 12:54:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157806</guid>
		<description><![CDATA[Option 4 is the best answer

UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

Eric
USA]]></description>
		<content:encoded><![CDATA[<p>Option 4 is the best answer</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Eric<br />
USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Somnath</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157779</link>
		<dc:creator><![CDATA[Somnath]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 12:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157779</guid>
		<description><![CDATA[Correct Option No. 4

UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

- Somnath Desai
   India]]></description>
		<content:encoded><![CDATA[<p>Correct Option No. 4</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>- Somnath Desai<br />
   India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Mohanrangan</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157768</link>
		<dc:creator><![CDATA[Rajesh Mohanrangan]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 11:37:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157768</guid>
		<description><![CDATA[Answer 4

# UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

From India]]></description>
		<content:encoded><![CDATA[<p>Answer 4</p>
<p># UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>From India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157705</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 08:08:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157705</guid>
		<description><![CDATA[Answer 4

4.UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

Country : India]]></description>
		<content:encoded><![CDATA[<p>Answer 4</p>
<p>4.UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Country : India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157662</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 06:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157662</guid>
		<description><![CDATA[&lt;p style=&quot;text-align:justify;&quot;&gt;&lt;strong&gt;Q 16) &lt;a title=&quot;Permanent Link to SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – System and Time Data Types – Day 16 of 35&quot; href=&quot;http://blog.sqlauthority.com/2011/08/16/sql-server-tips-from-the-sql-joes-2-pros-development-series-system-and-time-data-types-day-16-of-35/&quot; rel=&quot;bookmark&quot; rel=&quot;nofollow&quot;&gt;SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – System and Time Data Types – Day 16 of 35&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p style=&quot;text-align:justify;&quot;&gt;A.) Since Updated is not one of the temporary tables created by the UPDATE statement (1) and (2) are both incorrect answers.  Because Inserted.Hourly will contain the new value that was just inserted by the UPDATE statement and Deleted.Hourly will contain the old value that was just deleted (3) will not be correct either.  Since the code in (4) is referring to the Deleted.Hourly field as the OldPay and the Inserted.Hourly field as the NewPay it is the correct answer.&lt;/p&gt;

&lt;p style=&quot;text-align:justify;&quot;&gt;Winner from USA: &lt;b&gt;&lt;a href=&quot;http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157237&quot; rel=&quot;nofollow&quot;&gt;Bill Pepping&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:justify;&quot;&gt;Winner from India: &lt;b&gt;&lt;a href=&quot;http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/?trashed=1&amp;ids=157029#comment-157153&quot; rel=&quot;nofollow&quot;&gt;Gopalakrishnan Arthanarisamy&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;

I thank you all for participating here. The permanent record of this update is posted on &lt;a href=&quot;http://www.facebook.com/SQLAuth?sk=app_179191362131547&quot; rel=&quot;nofollow&quot;&gt;facebook&lt;/a&gt; page.]]></description>
		<content:encoded><![CDATA[<p style="text-align:justify;"><strong>Q 16) <a title="Permanent Link to SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – System and Time Data Types – Day 16 of 35" href="http://blog.sqlauthority.com/2011/08/16/sql-server-tips-from-the-sql-joes-2-pros-development-series-system-and-time-data-types-day-16-of-35/" rel="bookmark" rel="nofollow">SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – System and Time Data Types – Day 16 of 35</a></strong></p>
<p style="text-align:justify;">A.) Since Updated is not one of the temporary tables created by the UPDATE statement (1) and (2) are both incorrect answers.  Because Inserted.Hourly will contain the new value that was just inserted by the UPDATE statement and Deleted.Hourly will contain the old value that was just deleted (3) will not be correct either.  Since the code in (4) is referring to the Deleted.Hourly field as the OldPay and the Inserted.Hourly field as the NewPay it is the correct answer.</p>
<p style="text-align:justify;">Winner from USA: <b><a href="http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157237" rel="nofollow">Bill Pepping</a></b></p>
<p style="text-align:justify;">Winner from India: <b><a href="http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/?trashed=1&amp;ids=157029#comment-157153" rel="nofollow">Gopalakrishnan Arthanarisamy</a></b></p>
<p>I thank you all for participating here. The permanent record of this update is posted on <a href="http://www.facebook.com/SQLAuth?sk=app_179191362131547" rel="nofollow">facebook</a> page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Garg</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157659</link>
		<dc:creator><![CDATA[Rajesh Garg]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 06:12:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157659</guid>
		<description><![CDATA[answer  4 is correct.


UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL


Rajesh Garg
India]]></description>
		<content:encoded><![CDATA[<p>answer  4 is correct.</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Rajesh Garg<br />
India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj Sahoo</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157618</link>
		<dc:creator><![CDATA[Manoj Sahoo]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 04:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157618</guid>
		<description><![CDATA[UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay
WHERE Hourly IS NOT NULL


Scalable- Systems

Manoj Sahoo]]></description>
		<content:encoded><![CDATA[<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Inserted.Hourly as OldPay, Deleted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Scalable- Systems</p>
<p>Manoj Sahoo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JOHN</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157562</link>
		<dc:creator><![CDATA[JOHN]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 00:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157562</guid>
		<description><![CDATA[Correct answer is 4

UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

as the deletion of records happens first before insertion we must look for oldpay  in deleted table and newpay in insertion table.

USA]]></description>
		<content:encoded><![CDATA[<p>Correct answer is 4</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>as the deletion of records happens first before insertion we must look for oldpay  in deleted table and newpay in insertion table.</p>
<p>USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bhasker Reddy</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157487</link>
		<dc:creator><![CDATA[Bhasker Reddy]]></dc:creator>
		<pubDate>Mon, 15 Aug 2011 18:57:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157487</guid>
		<description><![CDATA[The correct answer is option 4.
UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

Here we want, empId which we are updating, so we can take this from inserted table or deleted table.
Old pay, first we delete old pay, we get this data from deleted table.
New pay,next we insert with new pay , we get this from inserted table.

bhasker
USA]]></description>
		<content:encoded><![CDATA[<p>The correct answer is option 4.<br />
UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Here we want, empId which we are updating, so we can take this from inserted table or deleted table.<br />
Old pay, first we delete old pay, we get this data from deleted table.<br />
New pay,next we insert with new pay , we get this from inserted table.</p>
<p>bhasker<br />
USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aas4mis</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157416</link>
		<dc:creator><![CDATA[aas4mis]]></dc:creator>
		<pubDate>Mon, 15 Aug 2011 13:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157416</guid>
		<description><![CDATA[The correct answer would be option 4.

UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

Options 1 and 2 reference a non-existent table (the &quot;UPDATE&quot; table). Option 3 is misleading as it would return the inverted values for OldPay and NewPay. Option 4 is correct.

Andre Soliz
USA]]></description>
		<content:encoded><![CDATA[<p>The correct answer would be option 4.</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Options 1 and 2 reference a non-existent table (the &#8220;UPDATE&#8221; table). Option 3 is misleading as it would return the inverted values for OldPay and NewPay. Option 4 is correct.</p>
<p>Andre Soliz<br />
USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramdas</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157415</link>
		<dc:creator><![CDATA[ramdas]]></dc:creator>
		<pubDate>Mon, 15 Aug 2011 13:21:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157415</guid>
		<description><![CDATA[Option 1 and Option 3 are correct.
Ramdas,NC,USA]]></description>
		<content:encoded><![CDATA[<p>Option 1 and Option 3 are correct.<br />
Ramdas,NC,USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neelesh</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157406</link>
		<dc:creator><![CDATA[Neelesh]]></dc:creator>
		<pubDate>Mon, 15 Aug 2011 12:50:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157406</guid>
		<description><![CDATA[4)

UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL

Location : India]]></description>
		<content:encoded><![CDATA[<p>4)</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
<p>Location : India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neelesh</title>
		<link>http://blog.sqlauthority.com/2011/08/14/sql-server-tips-from-the-sql-joes-2-pros-development-series-output-clause-in-simple-examples-day-14-of-35/#comment-157405</link>
		<dc:creator><![CDATA[Neelesh]]></dc:creator>
		<pubDate>Mon, 15 Aug 2011 12:49:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=13901#comment-157405</guid>
		<description><![CDATA[4)

UPDATE HourlyPay SET Hourly = Hourly + 1
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay
WHERE Hourly IS NOT NULL]]></description>
		<content:encoded><![CDATA[<p>4)</p>
<p>UPDATE HourlyPay SET Hourly = Hourly + 1<br />
OUTPUT Deleted.EmpID , Deleted.Hourly as OldPay, Inserted.Hourly as NewPay<br />
WHERE Hourly IS NOT NULL</p>
]]></content:encoded>
	</item>
</channel>
</rss>
