<?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; Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON &#8211; A Transactional Behavior</title>
	<atom:link href="http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/</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: Dick Borden</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-470895</link>
		<dc:creator><![CDATA[Dick Borden]]></dc:creator>
		<pubDate>Tue, 07 May 2013 19:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-470895</guid>
		<description><![CDATA[I believe I&#039;ve got the answer to the question posed in the first 1/6/10 reply in the thread... &quot;WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY] key, why ID =1 is ignored from table DupData while insertion, why not ignore ID = 3?&quot;. I believe/guess/intuit that it is because SQL Server does NOT &quot;ignore&quot; subsequent duplicates, rather it &quot;writes over&quot; the prior record with the most recent duplicate record&#039;s data. By changing the ORDER in which the records are inserted using ORDER BY ID &quot;DESC&quot; (rather than the default BY ID &quot;ASC&quot;), the ID=1 is kept rather than ID=3 -- the former being the more recent insertion of the two. If, indeed, this can be generalized, then it might be a GREAT way to eliminate duplicate keyed entries while keeping the most recent one -- just sort the to-be-inserted data in such a way that the most recent duplicate is inserted last.]]></description>
		<content:encoded><![CDATA[<p>I believe I&#8217;ve got the answer to the question posed in the first 1/6/10 reply in the thread&#8230; &#8220;WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY] key, why ID =1 is ignored from table DupData while insertion, why not ignore ID = 3?&#8221;. I believe/guess/intuit that it is because SQL Server does NOT &#8220;ignore&#8221; subsequent duplicates, rather it &#8220;writes over&#8221; the prior record with the most recent duplicate record&#8217;s data. By changing the ORDER in which the records are inserted using ORDER BY ID &#8220;DESC&#8221; (rather than the default BY ID &#8220;ASC&#8221;), the ID=1 is kept rather than ID=3 &#8212; the former being the more recent insertion of the two. If, indeed, this can be generalized, then it might be a GREAT way to eliminate duplicate keyed entries while keeping the most recent one &#8212; just sort the to-be-inserted data in such a way that the most recent duplicate is inserted last.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anita</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-408967</link>
		<dc:creator><![CDATA[Anita]]></dc:creator>
		<pubDate>Thu, 17 Jan 2013 14:32:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-408967</guid>
		<description><![CDATA[Hello Pinal,

I am using threading in my .net application and which is causing duplicates in my database, so when two threads are creating duplicates at the same time,  in this situation will this IGNORE_DUP_KEY = ON  work successfully?]]></description>
		<content:encoded><![CDATA[<p>Hello Pinal,</p>
<p>I am using threading in my .net application and which is causing duplicates in my database, so when two threads are creating duplicates at the same time,  in this situation will this IGNORE_DUP_KEY = ON  work successfully?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #011 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-406704</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #011 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 01:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-406704</guid>
		<description><![CDATA[[...] Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON – A Transactional Behavior [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON – A Transactional Behavior [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Select and Delete Duplicate Records &#8211; SQL in Sixty Seconds #036 &#8211; Video &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-395757</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Select and Delete Duplicate Records &#8211; SQL in Sixty Seconds #036 &#8211; Video &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Wed, 19 Dec 2012 01:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-395757</guid>
		<description><![CDATA[[...] Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON – A Transactional Behavior [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON – A Transactional Behavior [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-368359</link>
		<dc:creator><![CDATA[Ivan]]></dc:creator>
		<pubDate>Sat, 03 Nov 2012 04:24:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-368359</guid>
		<description><![CDATA[Hi Pinal,
I tried tweaking the same query using a clustered index and it gives a different result altogether. I am not sure but why is it that the SQL server engine works differently for different indexes. I&#039;m not too much in sql server so I&#039;m not sure whether I am asking the right question as clustered index on First Name sounds wierd.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
I tried tweaking the same query using a clustered index and it gives a different result altogether. I am not sure but why is it that the SQL server engine works differently for different indexes. I&#8217;m not too much in sql server so I&#8217;m not sure whether I am asking the right question as clustered index on First Name sounds wierd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian P. Hernandez</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-346550</link>
		<dc:creator><![CDATA[Brian P. Hernandez]]></dc:creator>
		<pubDate>Fri, 14 Sep 2012 18:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-346550</guid>
		<description><![CDATA[Hi.. this is my point.. i have 200 tables with million of rows each one, we want one unique table with unique email addresses, on that unique mail table i create 2columns pk_id (incremental), and email address , then i created an unique index with ignore_dup_key = ON , everything is fine, but when that table grow.. the insert of the remaining table is extremely slow... any suggestions? of how to accelerate the insert  on that huge unique column table???]]></description>
		<content:encoded><![CDATA[<p>Hi.. this is my point.. i have 200 tables with million of rows each one, we want one unique table with unique email addresses, on that unique mail table i create 2columns pk_id (incremental), and email address , then i created an unique index with ignore_dup_key = ON , everything is fine, but when that table grow.. the insert of the remaining table is extremely slow&#8230; any suggestions? of how to accelerate the insert  on that huge unique column table???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yunus</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-235906</link>
		<dc:creator><![CDATA[Yunus]]></dc:creator>
		<pubDate>Thu, 12 Jan 2012 08:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-235906</guid>
		<description><![CDATA[I have tried this without creating the Primary Key in the table, It works fine.]]></description>
		<content:encoded><![CDATA[<p>I have tried this without creating the Primary Key in the table, It works fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yunus</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-235888</link>
		<dc:creator><![CDATA[Yunus]]></dc:creator>
		<pubDate>Thu, 12 Jan 2012 07:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-235888</guid>
		<description><![CDATA[Hi,
I have a table as Test (VouDate Date, Narration Varchar(50)) where both are PK

Data
--------
insert into test values (&#039;2012-10-01&#039;,&#039;First-1&#039;);
insert into test values (&#039;2012-10-01&#039;,&#039;First-2&#039;);

insert into test values (&#039;2012-11-01&#039;,&#039;First-1&#039;);
insert into test values (&#039;2012-11-01&#039;,&#039;First-2&#039;);

When I select (select * from test order by 1) it returns
2012-10-01	First-1
2012-10-01	First-2
2012-11-01	First-1
2012-11-01	First-2 

And when I again insert
insert into test values (&#039;2012-10-01&#039;,&#039;First-3&#039;);
insert into test values (&#039;2012-10-01&#039;,&#039;First-0&#039;);

and select (select * from test order by 1), it returns 
2012-10-01	First-0
2012-10-01	First-1
2012-10-01	First-2
2012-10-01	First-3
2012-11-01	First-1
2012-11-01	First-2

I want to get the data as 
2012-10-01	First-1
2012-10-01	First-2
2012-10-01	First-3
2012-10-01	First-0

2012-11-01	First-1
2012-11-01	First-2

Please let me know if this is possible to sort the data by first column and second column get sorted by the insert sequence. 

Thanks,
Yunus]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have a table as Test (VouDate Date, Narration Varchar(50)) where both are PK</p>
<p>Data<br />
&#8212;&#8212;&#8211;<br />
insert into test values (&#8217;2012-10-01&#8242;,&#8217;First-1&#8242;);<br />
insert into test values (&#8217;2012-10-01&#8242;,&#8217;First-2&#8242;);</p>
<p>insert into test values (&#8217;2012-11-01&#8242;,&#8217;First-1&#8242;);<br />
insert into test values (&#8217;2012-11-01&#8242;,&#8217;First-2&#8242;);</p>
<p>When I select (select * from test order by 1) it returns<br />
2012-10-01	First-1<br />
2012-10-01	First-2<br />
2012-11-01	First-1<br />
2012-11-01	First-2 </p>
<p>And when I again insert<br />
insert into test values (&#8217;2012-10-01&#8242;,&#8217;First-3&#8242;);<br />
insert into test values (&#8217;2012-10-01&#8242;,&#8217;First-0&#8242;);</p>
<p>and select (select * from test order by 1), it returns<br />
2012-10-01	First-0<br />
2012-10-01	First-1<br />
2012-10-01	First-2<br />
2012-10-01	First-3<br />
2012-11-01	First-1<br />
2012-11-01	First-2</p>
<p>I want to get the data as<br />
2012-10-01	First-1<br />
2012-10-01	First-2<br />
2012-10-01	First-3<br />
2012-10-01	First-0</p>
<p>2012-11-01	First-1<br />
2012-11-01	First-2</p>
<p>Please let me know if this is possible to sort the data by first column and second column get sorted by the insert sequence. </p>
<p>Thanks,<br />
Yunus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deepak mariswamy</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-87986</link>
		<dc:creator><![CDATA[deepak mariswamy]]></dc:creator>
		<pubDate>Thu, 16 Sep 2010 04:48:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-87986</guid>
		<description><![CDATA[awesome.. helpful.]]></description>
		<content:encoded><![CDATA[<p>awesome.. helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-60074</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Fri, 22 Jan 2010 06:41:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-60074</guid>
		<description><![CDATA[Excellent Point Marko!

Loved your explanation.]]></description>
		<content:encoded><![CDATA[<p>Excellent Point Marko!</p>
<p>Loved your explanation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-60073</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Fri, 22 Jan 2010 06:28:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-60073</guid>
		<description><![CDATA[I actually found use for this!

I have a situation where I need to select data joining many tables, filter them using various rules and calculate some values out of them. I select data into table valued variable. After that I must update other tables depending what&#039;s in that temp table.

Now I don&#039;t want to have duplicate entries in that temp table. It wouldn&#039;t break anything but there could be A LOT of rows so I would have to do a lot of unnecessary updates and cause major havoc in the db with write locks.

I figured out that I could extract distinct rows out of the temp table but that would cause some extra work elsewhere in my procedure. So instead of that I just added &quot;with (IGNORE_DUP_KEY = ON)&quot; to the tables primary key and it seems to work like a charm :)]]></description>
		<content:encoded><![CDATA[<p>I actually found use for this!</p>
<p>I have a situation where I need to select data joining many tables, filter them using various rules and calculate some values out of them. I select data into table valued variable. After that I must update other tables depending what&#8217;s in that temp table.</p>
<p>Now I don&#8217;t want to have duplicate entries in that temp table. It wouldn&#8217;t break anything but there could be A LOT of rows so I would have to do a lot of unnecessary updates and cause major havoc in the db with write locks.</p>
<p>I figured out that I could extract distinct rows out of the temp table but that would cause some extra work elsewhere in my procedure. So instead of that I just added &#8220;with (IGNORE_DUP_KEY = ON)&#8221; to the tables primary key and it seems to work like a charm :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59466</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Fri, 08 Jan 2010 10:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59466</guid>
		<description><![CDATA[Not directly but with temporary table (ordinary will do also if you clean it up afterwards) it is possible. Create temporary table with unique index with IGNORE_DUP_KEY = ON. Select all the rows from original table to temporary table. Truncate original table and select all the rows from temporary table to (now clean) original table.

-- There&#039;s duplicate rows now
SELECT * FROM DupData ORDER BY ID
GO
-- Create temp table
CREATE TABLE #DupIndex (ID INT,
FirstName VARCHAR(100),
LastName VARCHAR(100),
City VARCHAR(100))
GO
-- And index
CREATE UNIQUE NONCLUSTERED INDEX [IX_DupIndex_FirstName]
ON [dbo].[#DupIndex]
(
[FirstName] ASC
) WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY]
GO
-- Select rows into temp table (duplicates are ignored)
INSERT INTO #DupIndex (ID,FirstName,LastName,City)
SELECT ID,FirstName,LastName,City
FROM DupData
ORDER BY ID
GO
-- Truncate table
TRUNCATE TABLE DupData;
GO
-- Select distinct rows back to table
INSERT INTO DupData (ID,FirstName,LastName,City)
SELECT ID,FirstName,LastName,City
FROM #DupIndex
ORDER BY ID
GO
-- Now there&#039;s now duplicate data
SELECT * FROM DupData ORDER BY ID
GO
-- Drop temp table
drop table #DupIndex;
GO]]></description>
		<content:encoded><![CDATA[<p>Not directly but with temporary table (ordinary will do also if you clean it up afterwards) it is possible. Create temporary table with unique index with IGNORE_DUP_KEY = ON. Select all the rows from original table to temporary table. Truncate original table and select all the rows from temporary table to (now clean) original table.</p>
<p>&#8211; There&#8217;s duplicate rows now<br />
SELECT * FROM DupData ORDER BY ID<br />
GO<br />
&#8211; Create temp table<br />
CREATE TABLE #DupIndex (ID INT,<br />
FirstName VARCHAR(100),<br />
LastName VARCHAR(100),<br />
City VARCHAR(100))<br />
GO<br />
&#8211; And index<br />
CREATE UNIQUE NONCLUSTERED INDEX [IX_DupIndex_FirstName]<br />
ON [dbo].[#DupIndex]<br />
(<br />
[FirstName] ASC<br />
) WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY]<br />
GO<br />
&#8211; Select rows into temp table (duplicates are ignored)<br />
INSERT INTO #DupIndex (ID,FirstName,LastName,City)<br />
SELECT ID,FirstName,LastName,City<br />
FROM DupData<br />
ORDER BY ID<br />
GO<br />
&#8211; Truncate table<br />
TRUNCATE TABLE DupData;<br />
GO<br />
&#8211; Select distinct rows back to table<br />
INSERT INTO DupData (ID,FirstName,LastName,City)<br />
SELECT ID,FirstName,LastName,City<br />
FROM #DupIndex<br />
ORDER BY ID<br />
GO<br />
&#8211; Now there&#8217;s now duplicate data<br />
SELECT * FROM DupData ORDER BY ID<br />
GO<br />
&#8211; Drop temp table<br />
drop table #DupIndex;<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vijayan</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59463</link>
		<dc:creator><![CDATA[vijayan]]></dc:creator>
		<pubDate>Fri, 08 Jan 2010 08:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59463</guid>
		<description><![CDATA[Hi,

 Shall i consider this as a new way for removing duplicate records from a table.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p> Shall i consider this as a new way for removing duplicate records from a table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59410</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 20:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59410</guid>
		<description><![CDATA[You mean like this?

SELECT        MIN(ID) AS ID, FirstName, LastName, City
FROM            DupData
GROUP BY FirstName, LastName, City
ORDER BY ID

It works but it&#039;s not very generic (or efficient) way to do it, I would say.]]></description>
		<content:encoded><![CDATA[<p>You mean like this?</p>
<p>SELECT        MIN(ID) AS ID, FirstName, LastName, City<br />
FROM            DupData<br />
GROUP BY FirstName, LastName, City<br />
ORDER BY ID</p>
<p>It works but it&#8217;s not very generic (or efficient) way to do it, I would say.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59409</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 20:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59409</guid>
		<description><![CDATA[Oh, now I see where this might come handy :)

But I think this is really limited situation where you&#039;d want to copy data from one table to another. Good to know that this kind of possibility exists though.]]></description>
		<content:encoded><![CDATA[<p>Oh, now I see where this might come handy :)</p>
<p>But I think this is really limited situation where you&#8217;d want to copy data from one table to another. Good to know that this kind of possibility exists though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Sentell</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59400</link>
		<dc:creator><![CDATA[Aaron Sentell]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 13:33:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59400</guid>
		<description><![CDATA[Hi Pinal,
Interesting use for this option. I always wondered how it might come in handy. The same result could be accomplished by using SELECT DISTINCT on the first table, but that would require sorting whereas the IGNORE_DUP_KEY option does not.

Aaron]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
Interesting use for this option. I always wondered how it might come in handy. The same result could be accomplished by using SELECT DISTINCT on the first table, but that would require sorting whereas the IGNORE_DUP_KEY option does not.</p>
<p>Aaron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59392</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 07:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59392</guid>
		<description><![CDATA[Hi Paresh,

The data specific query can be answered only if you provide table design and existing data in source and destination tables.

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hi Paresh,</p>
<p>The data specific query can be answered only if you provide table design and existing data in source and destination tables.</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paresh Prajapati</title>
		<link>http://blog.sqlauthority.com/2010/01/06/sql-server-unique-nonclustered-index-creation-with-ignore_dup_key-on-a-transactional-behavior/#comment-59389</link>
		<dc:creator><![CDATA[Paresh Prajapati]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 06:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7702#comment-59389</guid>
		<description><![CDATA[Hi Pinal,

Nice article.

I have one question,

-- Insert will throw warning
-- Warning will not insert duplicate row
INSERT INTO DupIndex (ID,FirstName,LastName,City)
SELECT ID,FirstName,LastName,City
FROM DupData
ORDER BY ID
GO

From above query, WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY] key, why ID =1 is ignored from table DupData while insertion, why not ignore ID = 3?]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Nice article.</p>
<p>I have one question,</p>
<p>&#8211; Insert will throw warning<br />
&#8211; Warning will not insert duplicate row<br />
INSERT INTO DupIndex (ID,FirstName,LastName,City)<br />
SELECT ID,FirstName,LastName,City<br />
FROM DupData<br />
ORDER BY ID<br />
GO</p>
<p>From above query, WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY] key, why ID =1 is ignored from table DupData while insertion, why not ignore ID = 3?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
