<?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; Performance Comparison &#8211; INSERT TOP (N) INTO Table &#8211; Using Top with INSERT</title>
	<atom:link href="http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/</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: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #019 &#124; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-434134</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #019 &#124; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 09 Mar 2013 01:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-434134</guid>
		<description><![CDATA[[...] Performance Comparison – INSERT TOP (N) INTO Table – Using Top with INSERT This has been one of the most fun blog posts ever. Initially I had no clue that TOP (N) even works with INSERT but later I learned the same and found it very interesting. In this blog post I have compared the performance between TOP N with INSERT and INSERT with SELECT N. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Performance Comparison – INSERT TOP (N) INTO Table – Using Top with INSERT This has been one of the most fun blog posts ever. Initially I had no clue that TOP (N) even works with INSERT but later I learned the same and found it very interesting. In this blog post I have compared the performance between TOP N with INSERT and INSERT with SELECT N. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 13 of 31 Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-147838</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 13 of 31 Journey to SQLAuthority]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 01:30:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-147838</guid>
		<description><![CDATA[[...] INSERT TOP (N) INTO Table is faster than Using Top with INSERT but when we use INSERT TOP (N) INTO Table, the ORDER BY clause is totally ignored. (Read more here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] INSERT TOP (N) INTO Table is faster than Using Top with INSERT but when we use INSERT TOP (N) INTO Table, the ORDER BY clause is totally ignored. (Read more here) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammed Mubarak</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-118461</link>
		<dc:creator><![CDATA[Mohammed Mubarak]]></dc:creator>
		<pubDate>Mon, 14 Feb 2011 12:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-118461</guid>
		<description><![CDATA[Hi,

I want clear picture of Execution Plan. plz do the needful.

Regards,
Mubarak]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I want clear picture of Execution Plan. plz do the needful.</p>
<p>Regards,<br />
Mubarak</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-79400</link>
		<dc:creator><![CDATA[Krishna]]></dc:creator>
		<pubDate>Fri, 09 Jul 2010 10:15:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-79400</guid>
		<description><![CDATA[/* Preserve the Order by enclosing SELECT code in EXEC without effecting performance. Query cost is for Option1 is 65% and for Option2 is 35% */

-- Option 1: Top with Select
INSERT INTO InsertTestValue (ID)
SELECT TOP (2) ID
FROM TestValue
ORDER BY ID DESC;
GO

-- Option 2: Top with Insert
INSERT TOP (2) INTO InsertTestValue1 (ID)
EXEC (&#039;SELECT ID
FROM TestValue
ORDER BY ID DESC&#039;);]]></description>
		<content:encoded><![CDATA[<p>/* Preserve the Order by enclosing SELECT code in EXEC without effecting performance. Query cost is for Option1 is 65% and for Option2 is 35% */</p>
<p>&#8211; Option 1: Top with Select<br />
INSERT INTO InsertTestValue (ID)<br />
SELECT TOP (2) ID<br />
FROM TestValue<br />
ORDER BY ID DESC;<br />
GO</p>
<p>&#8211; Option 2: Top with Insert<br />
INSERT TOP (2) INTO InsertTestValue1 (ID)<br />
EXEC (&#8216;SELECT ID<br />
FROM TestValue<br />
ORDER BY ID DESC&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62159</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Thu, 04 Mar 2010 11:20:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62159</guid>
		<description><![CDATA[Yes. It has the same effect for temp tables and table variables]]></description>
		<content:encoded><![CDATA[<p>Yes. It has the same effect for temp tables and table variables</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62158</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Thu, 04 Mar 2010 11:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62158</guid>
		<description><![CDATA[This is the expected behaviour

As per BOL

TOP ( expression ) [ PERCENT ]
Specifies the number or percent of random rows that will be inserted. expression can be either a number or a percent of the rows. The rows referenced in the TOP expression that are used with INSERT, UPDATE, or DELETE are not arranged in any order.]]></description>
		<content:encoded><![CDATA[<p>This is the expected behaviour</p>
<p>As per BOL</p>
<p>TOP ( expression ) [ PERCENT ]<br />
Specifies the number or percent of random rows that will be inserted. expression can be either a number or a percent of the rows. The rows referenced in the TOP expression that are used with INSERT, UPDATE, or DELETE are not arranged in any order.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sushil</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62097</link>
		<dc:creator><![CDATA[Sushil]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 17:26:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62097</guid>
		<description><![CDATA[It is understood how the SQL Server deals with Insert Top (N) into..Select  .... and Insert into...Select Top (N) and their performance as well... I dont think comparison here is needed since the results are different.

I wanted to know why in the backgroud SQL Server is unable to Order By when Top is issued with Insert. I would really appreciate if you could clarify. Thanks much.]]></description>
		<content:encoded><![CDATA[<p>It is understood how the SQL Server deals with Insert Top (N) into..Select  &#8230;. and Insert into&#8230;Select Top (N) and their performance as well&#8230; I dont think comparison here is needed since the results are different.</p>
<p>I wanted to know why in the backgroud SQL Server is unable to Order By when Top is issued with Insert. I would really appreciate if you could clarify. Thanks much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramdas</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62089</link>
		<dc:creator><![CDATA[Ramdas]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 14:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62089</guid>
		<description><![CDATA[Interesting to see how the results are diferent with the diferent placement of the TOP clause.  Thanks for the examples.]]></description>
		<content:encoded><![CDATA[<p>Interesting to see how the results are diferent with the diferent placement of the TOP clause.  Thanks for the examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zuberkhan</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62068</link>
		<dc:creator><![CDATA[Zuberkhan]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 08:29:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62068</guid>
		<description><![CDATA[Performance of 2nd query is better because SORT operation is not used to retrieve the records (pls see the execution plan). Both of these queries performance should be evaluated by removing order by clause.]]></description>
		<content:encoded><![CDATA[<p>Performance of 2nd query is better because SORT operation is not used to retrieve the records (pls see the execution plan). Both of these queries performance should be evaluated by removing order by clause.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62062</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 07:37:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62062</guid>
		<description><![CDATA[Table variable OR Temp tables are totally different things. We will talk some other time on them.

Kind Regards,
Pinal]]></description>
		<content:encoded><![CDATA[<p>Table variable OR Temp tables are totally different things. We will talk some other time on them.</p>
<p>Kind Regards,<br />
Pinal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejas Shah</title>
		<link>http://blog.sqlauthority.com/2010/03/03/sql-server-performance-comparison-insert-top-n-into-table-using-top-with-insert/#comment-62061</link>
		<dc:creator><![CDATA[Tejas Shah]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 06:52:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8102#comment-62061</guid>
		<description><![CDATA[Excellent comparison.

Need to check this in detail...you give a new way to consider this thing too.

One question in my mind is:

Is it same for Table variable OR Temp tables?

Tejas
SQLYoga.com]]></description>
		<content:encoded><![CDATA[<p>Excellent comparison.</p>
<p>Need to check this in detail&#8230;you give a new way to consider this thing too.</p>
<p>One question in my mind is:</p>
<p>Is it same for Table variable OR Temp tables?</p>
<p>Tejas<br />
SQLYoga.com</p>
]]></content:encoded>
	</item>
</channel>
</rss>
