<?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; INSERT TOP (N) INTO Table &#8211; Using Top with INSERT</title>
	<atom:link href="http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/02/27/sql-server-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; #018 &#124; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-430061</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #018 &#124; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 02 Mar 2013 01:31:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-430061</guid>
		<description><![CDATA[[...] INSERT TOP (N) INTO Table – Using Top with INSERT [...]]]></description>
		<content:encoded><![CDATA[<p>[...] INSERT TOP (N) INTO Table – Using Top with INSERT [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robby</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-398843</link>
		<dc:creator><![CDATA[robby]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 03:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-398843</guid>
		<description><![CDATA[i need help for my data mining project , i want to make a split row from my table into 2 new table(training,testing) .. how the sql statement move random row into new table from old table ??]]></description>
		<content:encoded><![CDATA[<p>i need help for my data mining project , i want to make a split row from my table into 2 new table(training,testing) .. how the sql statement move random row into new table from old table ??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DHiraj</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-397826</link>
		<dc:creator><![CDATA[DHiraj]]></dc:creator>
		<pubDate>Sat, 22 Dec 2012 20:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-397826</guid>
		<description><![CDATA[Dear Sir ,
How i can Add the new column  in any Old Existing Table at First,Middle and Last position by query.Please give me some proper query .

Thanks,
D K Dhiraj]]></description>
		<content:encoded><![CDATA[<p>Dear Sir ,<br />
How i can Add the new column  in any Old Existing Table at First,Middle and Last position by query.Please give me some proper query .</p>
<p>Thanks,<br />
D K Dhiraj</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bibhu</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-289080</link>
		<dc:creator><![CDATA[Bibhu]]></dc:creator>
		<pubDate>Sat, 26 May 2012 12:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-289080</guid>
		<description><![CDATA[@Pinal - But why does the second method ignores the &quot;Oder By&quot; clause. Is the &quot;Select&quot; statement not  ordering the column ID in descending order or the it is but the &quot;Insert&quot; statement is again sorting it in ascending order and inserting the top 2 rows ?]]></description>
		<content:encoded><![CDATA[<p>@Pinal &#8211; But why does the second method ignores the &#8220;Oder By&#8221; clause. Is the &#8220;Select&#8221; statement not  ordering the column ID in descending order or the it is but the &#8220;Insert&#8221; statement is again sorting it in ascending order and inserting the top 2 rows ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HumanJHawkins</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-283987</link>
		<dc:creator><![CDATA[HumanJHawkins]]></dc:creator>
		<pubDate>Fri, 11 May 2012 23:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-283987</guid>
		<description><![CDATA[The word &quot;random&quot; is often used incorrectly, so I have a hard time trusting it when I see it. Microsoft also describes that the rows are inserted randomly.

I need to take a random sample of 5000 rows for each of several types of things in one big table. If &quot;INSERT TOP 5000&quot; really will pull 5000 rows randomly, then I am all set. But if this is really just pulling 5000 rows from the table while an unknown sort order is applied, it will not work.

Can anyone confirm or deny that this is truely random (or at least as pseudorandom as computers can get)?

Thanks in advance.]]></description>
		<content:encoded><![CDATA[<p>The word &#8220;random&#8221; is often used incorrectly, so I have a hard time trusting it when I see it. Microsoft also describes that the rows are inserted randomly.</p>
<p>I need to take a random sample of 5000 rows for each of several types of things in one big table. If &#8220;INSERT TOP 5000&#8243; really will pull 5000 rows randomly, then I am all set. But if this is really just pulling 5000 rows from the table while an unknown sort order is applied, it will not work.</p>
<p>Can anyone confirm or deny that this is truely random (or at least as pseudorandom as computers can get)?</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seattle</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-277634</link>
		<dc:creator><![CDATA[Seattle]]></dc:creator>
		<pubDate>Thu, 19 Apr 2012 18:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-277634</guid>
		<description><![CDATA[Hello everyone,

I am new and trying to make use of Top 100, to limit the number of records which are inserted into my temp table, but getting error message(s)

Error 1 : Incorrect syntax near keyword &#039;top&#039;
insert top 100 into #TEMP_DATES  
    ( 
            A, 
            B, 
            C, 
            D
    ) 
    select 
            1, 
            2, 
            3, 
            4
    from 
            #TEMP_M_Date

Error 2 : Incorrect syntax near &#039;100&#039;
insert top (100) into #TEMP_DATES  
    ( 
            A, 
            B, 
            C, 
            D
    ) 
    select 
            1, 
            2, 
            3, 
            4
    from 
            #TEMP_M_Date


Please help me understand the syntax, I am using SQL advantage (and working on sybase)

Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hello everyone,</p>
<p>I am new and trying to make use of Top 100, to limit the number of records which are inserted into my temp table, but getting error message(s)</p>
<p>Error 1 : Incorrect syntax near keyword &#8216;top&#8217;<br />
insert top 100 into #TEMP_DATES<br />
    (<br />
            A,<br />
            B,<br />
            C,<br />
            D<br />
    )<br />
    select<br />
            1,<br />
            2,<br />
            3,<br />
            4<br />
    from<br />
            #TEMP_M_Date</p>
<p>Error 2 : Incorrect syntax near &#8217;100&#8242;<br />
insert top (100) into #TEMP_DATES<br />
    (<br />
            A,<br />
            B,<br />
            C,<br />
            D<br />
    )<br />
    select<br />
            1,<br />
            2,<br />
            3,<br />
            4<br />
    from<br />
            #TEMP_M_Date</p>
<p>Please help me understand the syntax, I am using SQL advantage (and working on sybase)</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yoy_158</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-212127</link>
		<dc:creator><![CDATA[Yoy_158]]></dc:creator>
		<pubDate>Tue, 06 Dec 2011 15:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-212127</guid>
		<description><![CDATA[Great article.

I found this blog when I am looking for using Insert Top for the batch insert.  Basically, I have the situation that requires insert 10 mil. Rows in a table.  In order to avoid blocking, I have to using some sort of batch insert technique.  Will this Insert Top help?  Would you please give out an example?

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Great article.</p>
<p>I found this blog when I am looking for using Insert Top for the batch insert.  Basically, I have the situation that requires insert 10 mil. Rows in a table.  In order to avoid blocking, I have to using some sort of batch insert technique.  Will this Insert Top help?  Would you please give out an example?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-186414</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 01 Nov 2011 13:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-186414</guid>
		<description><![CDATA[Yes it is true. ORDER BY is guaranteed only in SELECT statement]]></description>
		<content:encoded><![CDATA[<p>Yes it is true. ORDER BY is guaranteed only in SELECT statement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom McCann</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-186233</link>
		<dc:creator><![CDATA[Tom McCann]]></dc:creator>
		<pubDate>Tue, 01 Nov 2011 05:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-186233</guid>
		<description><![CDATA[I&#039;m absolutely appalled by the fact that it ignores the ORDER BY clause with no warning whatsoever. I am learning T-SQL and have found so many unintuitive &#039;gotchas&#039; like this in the language. It is too easy to make unintended mistakes.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m absolutely appalled by the fact that it ignores the ORDER BY clause with no warning whatsoever. I am learning T-SQL and have found so many unintuitive &#8216;gotchas&#8217; like this in the language. It is too easy to make unintended mistakes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-144871</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 30 Jun 2011 13:33:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-144871</guid>
		<description><![CDATA[This is not supported in version 2000. Available only from version 2005]]></description>
		<content:encoded><![CDATA[<p>This is not supported in version 2000. Available only from version 2005</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anbu</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-144835</link>
		<dc:creator><![CDATA[anbu]]></dc:creator>
		<pubDate>Thu, 30 Jun 2011 10:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-144835</guid>
		<description><![CDATA[hi pinal.This code is not working in sql server 2000.]]></description>
		<content:encoded><![CDATA[<p>hi pinal.This code is not working in sql server 2000.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjun Khanal</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-110595</link>
		<dc:creator><![CDATA[Arjun Khanal]]></dc:creator>
		<pubDate>Wed, 12 Jan 2011 09:44:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-110595</guid>
		<description><![CDATA[Hi Yogi,

I frequently use &quot;select * into &quot; for inserting into one table from another table with same column fields of same database or different database.

select * into tableA(columns) from tableB(columns)

Your can modify this if you are working with two database:

select * into DatabaseA.dbo.tableA from DatabaseB.dbo.tableA

Hope you will find this useful.]]></description>
		<content:encoded><![CDATA[<p>Hi Yogi,</p>
<p>I frequently use &#8220;select * into &#8221; for inserting into one table from another table with same column fields of same database or different database.</p>
<p>select * into tableA(columns) from tableB(columns)</p>
<p>Your can modify this if you are working with two database:</p>
<p>select * into DatabaseA.dbo.tableA from DatabaseB.dbo.tableA</p>
<p>Hope you will find this useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: akhilesh</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-84548</link>
		<dc:creator><![CDATA[akhilesh]]></dc:creator>
		<pubDate>Wed, 18 Aug 2010 16:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-84548</guid>
		<description><![CDATA[how we can insert the data in a join table by use of stored procedure]]></description>
		<content:encoded><![CDATA[<p>how we can insert the data in a join table by use of stored procedure</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yogi Raj</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-80504</link>
		<dc:creator><![CDATA[Yogi Raj]]></dc:creator>
		<pubDate>Fri, 16 Jul 2010 12:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-80504</guid>
		<description><![CDATA[thanks guys ..]]></description>
		<content:encoded><![CDATA[<p>thanks guys ..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-80438</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Fri, 16 Jul 2010 00:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-80438</guid>
		<description><![CDATA[@Yogi

Insert into TableB (Column Names)
Select Column Names from TableA

~Peace.]]></description>
		<content:encoded><![CDATA[<p>@Yogi</p>
<p>Insert into TableB (Column Names)<br />
Select Column Names from TableA</p>
<p>~Peace.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-80397</link>
		<dc:creator><![CDATA[Krishna]]></dc:creator>
		<pubDate>Thu, 15 Jul 2010 11:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-80397</guid>
		<description><![CDATA[method1: insert into B () select * from B 
method2: select * insert into B from A
use method1 instead of method2.....method2 is usually used to create a new table whose columns and datatypes match the parent table]]></description>
		<content:encoded><![CDATA[<p>method1: insert into B () select * from B<br />
method2: select * insert into B from A<br />
use method1 instead of method2&#8230;..method2 is usually used to create a new table whose columns and datatypes match the parent table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yogi Raj</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-80374</link>
		<dc:creator><![CDATA[Yogi Raj]]></dc:creator>
		<pubDate>Thu, 15 Jul 2010 06:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-80374</guid>
		<description><![CDATA[Hi guys, i am new to this, plz help. 

selecting all the columns from table A (i.e. select * from A) and inserting them into a dataset B which is already existing having the same column names.

How can i do that :( ?]]></description>
		<content:encoded><![CDATA[<p>Hi guys, i am new to this, plz help. </p>
<p>selecting all the columns from table A (i.e. select * from A) and inserting them into a dataset B which is already existing having the same column names.</p>
<p>How can i do that :( ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-79398</link>
		<dc:creator><![CDATA[Krishna]]></dc:creator>
		<pubDate>Fri, 09 Jul 2010 09:55:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-79398</guid>
		<description><![CDATA[/* But if you are so particular about the order, enclose your SELECT code in EXEC */

use AdventureWorks;
go
CREATE TABLE dbo.SickLeave1
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)
GO
INSERT TOP (10)PERCENT
SickLeave1(EmployeeID,FullName,SickLeaveHours)
EXEC (&#039;SELECT 
EmployeeID, FirstName + &#039;&#039; &#039;&#039; + LastName, SickLeaveHours
FROM Person.Contact JOIN HumanResources.Employee
ON Person.Contact.ContactID = HumanResources.Employee.ContactID
ORDER BY SickLeaveHours DESC&#039;)
go
CREATE TABLE dbo.SickLeave2
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)
GO
INSERT TOP (10)PERCENT
SickLeave2
EXEC (&#039;SELECT 
EmployeeID, FirstName + &#039;&#039; &#039;&#039; + LastName, SickLeaveHours
FROM Person.Contact JOIN HumanResources.Employee
ON Person.Contact.ContactID = HumanResources.Employee.ContactID
ORDER BY EmployeeID DESC&#039;)

select * from SickLeave1 order by EmployeeID;
select * from SickLeave2 order by EmployeeID;

drop table SickLeave1
drop table SickLeave2

PS:Sorry for lengthy comments.]]></description>
		<content:encoded><![CDATA[<p>/* But if you are so particular about the order, enclose your SELECT code in EXEC */</p>
<p>use AdventureWorks;<br />
go<br />
CREATE TABLE dbo.SickLeave1<br />
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)<br />
GO<br />
INSERT TOP (10)PERCENT<br />
SickLeave1(EmployeeID,FullName,SickLeaveHours)<br />
EXEC (&#8216;SELECT<br />
EmployeeID, FirstName + &#8221; &#8221; + LastName, SickLeaveHours<br />
FROM Person.Contact JOIN HumanResources.Employee<br />
ON Person.Contact.ContactID = HumanResources.Employee.ContactID<br />
ORDER BY SickLeaveHours DESC&#8217;)<br />
go<br />
CREATE TABLE dbo.SickLeave2<br />
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)<br />
GO<br />
INSERT TOP (10)PERCENT<br />
SickLeave2<br />
EXEC (&#8216;SELECT<br />
EmployeeID, FirstName + &#8221; &#8221; + LastName, SickLeaveHours<br />
FROM Person.Contact JOIN HumanResources.Employee<br />
ON Person.Contact.ContactID = HumanResources.Employee.ContactID<br />
ORDER BY EmployeeID DESC&#8217;)</p>
<p>select * from SickLeave1 order by EmployeeID;<br />
select * from SickLeave2 order by EmployeeID;</p>
<p>drop table SickLeave1<br />
drop table SickLeave2</p>
<p>PS:Sorry for lengthy comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-79354</link>
		<dc:creator><![CDATA[Krishna]]></dc:creator>
		<pubDate>Fri, 09 Jul 2010 05:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-79354</guid>
		<description><![CDATA[use AdventureWorks;
go
CREATE TABLE dbo.SickLeave1
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)
GO
INSERT TOP (10)PERCENT
SickLeave1
SELECT
EmployeeID, FirstName + &#039; &#039; + LastName, SickLeaveHours
FROM Person.Contact JOIN HumanResources.Employee
ON Person.Contact.ContactID = HumanResources.Employee.ContactID
ORDER BY SickLeaveHours DESC
go
CREATE TABLE dbo.SickLeave2
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)
GO
INSERT TOP (10)PERCENT
SickLeave2
SELECT 
EmployeeID, FirstName + &#039; &#039; + LastName, SickLeaveHours
FROM Person.Contact JOIN HumanResources.Employee
ON Person.Contact.ContactID = HumanResources.Employee.ContactID
ORDER BY EmployeeID DESC;

select * from SickLeave1 order by EmployeeID;
select * from SickLeave2 order by EmployeeID;

drop table SickLeave1
drop table SickLeave2

Observe the ORDER BY cluase in both inserts....
Result: Same result from SickLeave1 and SickLeave2
--&gt;The rows referenced in the TOP expression that are used with INSERT, UPDATE, or DELETE are not arranged in any order.
ref:http://msdn.microsoft.com/en-us/library/ms174335.aspx]]></description>
		<content:encoded><![CDATA[<p>use AdventureWorks;<br />
go<br />
CREATE TABLE dbo.SickLeave1<br />
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)<br />
GO<br />
INSERT TOP (10)PERCENT<br />
SickLeave1<br />
SELECT<br />
EmployeeID, FirstName + &#8216; &#8216; + LastName, SickLeaveHours<br />
FROM Person.Contact JOIN HumanResources.Employee<br />
ON Person.Contact.ContactID = HumanResources.Employee.ContactID<br />
ORDER BY SickLeaveHours DESC<br />
go<br />
CREATE TABLE dbo.SickLeave2<br />
(EmployeeID int, FullName nvarchar(100), SickLeaveHours int)<br />
GO<br />
INSERT TOP (10)PERCENT<br />
SickLeave2<br />
SELECT<br />
EmployeeID, FirstName + &#8216; &#8216; + LastName, SickLeaveHours<br />
FROM Person.Contact JOIN HumanResources.Employee<br />
ON Person.Contact.ContactID = HumanResources.Employee.ContactID<br />
ORDER BY EmployeeID DESC;</p>
<p>select * from SickLeave1 order by EmployeeID;<br />
select * from SickLeave2 order by EmployeeID;</p>
<p>drop table SickLeave1<br />
drop table SickLeave2</p>
<p>Observe the ORDER BY cluase in both inserts&#8230;.<br />
Result: Same result from SickLeave1 and SickLeave2<br />
&#8211;&gt;The rows referenced in the TOP expression that are used with INSERT, UPDATE, or DELETE are not arranged in any order.<br />
ref:<a href="http://msdn.microsoft.com/en-us/library/ms174335.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms174335.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: umesh chand</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-64729</link>
		<dc:creator><![CDATA[umesh chand]]></dc:creator>
		<pubDate>Wed, 07 Apr 2010 11:48:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-64729</guid>
		<description><![CDATA[I would like to know is it possible to insert a new row in first position in existing table using sql.
Please let me if it is possible]]></description>
		<content:encoded><![CDATA[<p>I would like to know is it possible to insert a new row in first position in existing table using sql.<br />
Please let me if it is possible</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-62370</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Mon, 08 Mar 2010 08:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-62370</guid>
		<description><![CDATA[Yes. It is not bad. But Order is not gauranteed]]></description>
		<content:encoded><![CDATA[<p>Yes. It is not bad. But Order is not gauranteed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-62156</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Thu, 04 Mar 2010 11:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-62156</guid>
		<description><![CDATA[The second method can be used randomly copy the rows so ORDER BY will be omitted automatically]]></description>
		<content:encoded><![CDATA[<p>The second method can be used randomly copy the rows so ORDER BY will be omitted automatically</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kuldip.Bhatt</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-62128</link>
		<dc:creator><![CDATA[Kuldip.Bhatt]]></dc:creator>
		<pubDate>Thu, 04 Mar 2010 06:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-62128</guid>
		<description><![CDATA[Sir,

if it is ignoring Order by 
what meaning  of Second Method ?
any other purpose can we use this ?]]></description>
		<content:encoded><![CDATA[<p>Sir,</p>
<p>if it is ignoring Order by<br />
what meaning  of Second Method ?<br />
any other purpose can we use this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Performance Comparison – INSERT TOP (N) INTO Table – Using Top with INSERT Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-62053</link>
		<dc:creator><![CDATA[SQL SERVER – Performance Comparison – INSERT TOP (N) INTO Table – Using Top with INSERT Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 01:32:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-62053</guid>
		<description><![CDATA[[...] 3, 2010 by pinaldave    Recently I wrote about SQL SERVER – INSERT TOP (N) INTO Table – Using Top with INSERT I mentioned about how TOP works with INSERT. I have mentioned that I will write about the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 3, 2010 by pinaldave    Recently I wrote about SQL SERVER – INSERT TOP (N) INTO Table – Using Top with INSERT I mentioned about how TOP works with INSERT. I have mentioned that I will write about the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susantha</title>
		<link>http://blog.sqlauthority.com/2010/02/27/sql-server-insert-top-n-into-table-using-top-with-insert/#comment-61885</link>
		<dc:creator><![CDATA[Susantha]]></dc:creator>
		<pubDate>Sat, 27 Feb 2010 13:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8064#comment-61885</guid>
		<description><![CDATA[It is really a cool feature but I&#039;m eager to see the performance of these two methods in your future articles. I don&#039;t think 2nd method is bad over the other.]]></description>
		<content:encoded><![CDATA[<p>It is really a cool feature but I&#8217;m eager to see the performance of these two methods in your future articles. I don&#8217;t think 2nd method is bad over the other.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
