<?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; Select and Delete Duplicate Records &#8211; SQL in Sixty Seconds #036 &#8211; Video</title>
	<atom:link href="http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 23 May 2013 13:14:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Anuj Grewal</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-454423</link>
		<dc:creator><![CDATA[Anuj Grewal]]></dc:creator>
		<pubDate>Fri, 12 Apr 2013 10:41:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-454423</guid>
		<description><![CDATA[DELETE
FROM TestTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM TestTable
GROUP BY NameCol)
this is not working ...............]]></description>
		<content:encoded><![CDATA[<p>DELETE<br />
FROM TestTable<br />
WHERE ID NOT IN<br />
(<br />
SELECT MAX(ID)<br />
FROM TestTable<br />
GROUP BY NameCol)<br />
this is not working &#8230;&#8230;&#8230;&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandar Shindagi</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-433375</link>
		<dc:creator><![CDATA[Mandar Shindagi]]></dc:creator>
		<pubDate>Thu, 07 Mar 2013 12:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-433375</guid>
		<description><![CDATA[Sanjay, I think you are overcomplicating this. If you have a single column table, do a SELECT DISTINCT into a temp table, truncate your single column table and INSERT the distinct values back from temp table.
You may want to go one step further by adding a PK constraint for future proofing.
Hope this helps.

Pinal, nice post mate.]]></description>
		<content:encoded><![CDATA[<p>Sanjay, I think you are overcomplicating this. If you have a single column table, do a SELECT DISTINCT into a temp table, truncate your single column table and INSERT the distinct values back from temp table.<br />
You may want to go one step further by adding a PK constraint for future proofing.<br />
Hope this helps.</p>
<p>Pinal, nice post mate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DoronF</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-433051</link>
		<dc:creator><![CDATA[DoronF]]></dc:creator>
		<pubDate>Wed, 06 Mar 2013 22:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-433051</guid>
		<description><![CDATA[Hi Pinal

I appreciate the info in this article. 

Removing duplicate records could be a tedious job especially when you have hundreds of millions of records in one table. When removing duplicate records you may want to combine different fields’ values in one good record. Say you have a Phone Number in one records and DOB in another record but they are duplicate based on First, Last and Address. 

Here is an article that will discuss the above issues and how to resolve the problem while integrating all required fields in one good record. http://www.dfarber.com/computer-consulting-blog/2011/12/26/remove-duplicate-records-in-sql.aspx
Any feedback is appreciated. 

Regards,

Doron]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal</p>
<p>I appreciate the info in this article. </p>
<p>Removing duplicate records could be a tedious job especially when you have hundreds of millions of records in one table. When removing duplicate records you may want to combine different fields’ values in one good record. Say you have a Phone Number in one records and DOB in another record but they are duplicate based on First, Last and Address. </p>
<p>Here is an article that will discuss the above issues and how to resolve the problem while integrating all required fields in one good record. <a href="http://www.dfarber.com/computer-consulting-blog/2011/12/26/remove-duplicate-records-in-sql.aspx" rel="nofollow">http://www.dfarber.com/computer-consulting-blog/2011/12/26/remove-duplicate-records-in-sql.aspx</a><br />
Any feedback is appreciated. </p>
<p>Regards,</p>
<p>Doron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Fix: Error: 1505 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name and the index name &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-417910</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Fix: Error: 1505 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name and the index name &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Tue, 05 Feb 2013 01:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-417910</guid>
		<description><![CDATA[[...] On Separate note, here is the blog post with video which explains how you can delete the duplicate row from the table: Select and Delete Duplicate Records – SQL in Sixty Seconds #036 – Video. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] On Separate note, here is the blog post with video which explains how you can delete the duplicate row from the table: Select and Delete Duplicate Records – SQL in Sixty Seconds #036 – Video. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjay Monpara</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396965</link>
		<dc:creator><![CDATA[Sanjay Monpara]]></dc:creator>
		<pubDate>Fri, 21 Dec 2012 05:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396965</guid>
		<description><![CDATA[Very good Scott
Its perfect!!!]]></description>
		<content:encoded><![CDATA[<p>Very good Scott<br />
Its perfect!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott McPhaed</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396764</link>
		<dc:creator><![CDATA[Scott McPhaed]]></dc:creator>
		<pubDate>Thu, 20 Dec 2012 19:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396764</guid>
		<description><![CDATA[You can also use newID():

WITH cte(NameCol, RankField)
     AS (SELECT NameCol
                , RankField = DENSE_RANK()
                                OVER (
                                  PARTITION BY NameCol
                                  ORDER BY newID())
         FROM
           TestTable)
DELETE FROM cte
WHERE  RankField &gt; 1]]></description>
		<content:encoded><![CDATA[<p>You can also use newID():</p>
<p>WITH cte(NameCol, RankField)<br />
     AS (SELECT NameCol<br />
                , RankField = DENSE_RANK()<br />
                                OVER (<br />
                                  PARTITION BY NameCol<br />
                                  ORDER BY newID())<br />
         FROM<br />
           TestTable)<br />
DELETE FROM cte<br />
WHERE  RankField &gt; 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjay Monpara</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396421</link>
		<dc:creator><![CDATA[Sanjay Monpara]]></dc:creator>
		<pubDate>Thu, 20 Dec 2012 05:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396421</guid>
		<description><![CDATA[One doubt,
we have to pass where condition to update records, then here possibility to update same row_num for duplicate records, isn&#039;t it?]]></description>
		<content:encoded><![CDATA[<p>One doubt,<br />
we have to pass where condition to update records, then here possibility to update same row_num for duplicate records, isn&#8217;t it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Kolahdoozan</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396387</link>
		<dc:creator><![CDATA[Ali Kolahdoozan]]></dc:creator>
		<pubDate>Thu, 20 Dec 2012 04:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396387</guid>
		<description><![CDATA[How could I user Row_Number in Delete Statement ?.If we did not have ID column , we are not able to delete duplicated record.]]></description>
		<content:encoded><![CDATA[<p>How could I user Row_Number in Delete Statement ?.If we did not have ID column , we are not able to delete duplicated record.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396364</link>
		<dc:creator><![CDATA[Garrett]]></dc:creator>
		<pubDate>Thu, 20 Dec 2012 03:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396364</guid>
		<description><![CDATA[You don&#039;t need to append a new column in the table, that is incorrect. You can utilize the row_number() and delete the duplicate records without creating a new column on the table.]]></description>
		<content:encoded><![CDATA[<p>You don&#8217;t need to append a new column in the table, that is incorrect. You can utilize the row_number() and delete the duplicate records without creating a new column on the table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaz</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396142</link>
		<dc:creator><![CDATA[Kaz]]></dc:creator>
		<pubDate>Wed, 19 Dec 2012 15:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396142</guid>
		<description><![CDATA[You will need to append a new column in your table, and then update it with row_number over (partition by namecol order by namecol), and then execute a delete command, delete from tabel where row_num &gt; 1]]></description>
		<content:encoded><![CDATA[<p>You will need to append a new column in your table, and then update it with row_number over (partition by namecol order by namecol), and then execute a delete command, delete from tabel where row_num &gt; 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjay Monpara</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-396061</link>
		<dc:creator><![CDATA[Sanjay Monpara]]></dc:creator>
		<pubDate>Wed, 19 Dec 2012 12:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-396061</guid>
		<description><![CDATA[suppose single column table cantains records like below

NameCol
--------
First
Second
Second
Second
Second
Third

Then how its possible to delete duplicate records using row_number() function.
even if SSMS not allows to delete single record from duplicate set &amp; showing error.]]></description>
		<content:encoded><![CDATA[<p>suppose single column table cantains records like below</p>
<p>NameCol<br />
&#8212;&#8212;&#8211;<br />
First<br />
Second<br />
Second<br />
Second<br />
Second<br />
Third</p>
<p>Then how its possible to delete duplicate records using row_number() function.<br />
even if SSMS not allows to delete single record from duplicate set &amp; showing error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naren</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-395990</link>
		<dc:creator><![CDATA[Naren]]></dc:creator>
		<pubDate>Wed, 19 Dec 2012 10:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-395990</guid>
		<description><![CDATA[@Sanjay

You can use ROW_NUMBER() function in this case]]></description>
		<content:encoded><![CDATA[<p>@Sanjay</p>
<p>You can use ROW_NUMBER() function in this case</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjay Monpara</title>
		<link>http://blog.sqlauthority.com/2012/12/19/sql-server-select-and-delete-duplicate-records-sql-in-sixty-seconds-036-video/#comment-395870</link>
		<dc:creator><![CDATA[Sanjay Monpara]]></dc:creator>
		<pubDate>Wed, 19 Dec 2012 06:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=22090#comment-395870</guid>
		<description><![CDATA[In oracle we can use ROWID Pseudocolumn,
It helps to delete records even if table not contains incremental unique id &amp; without using another temp table.

Is there any method in sql server to delete records in such situation without using another(temp) table?]]></description>
		<content:encoded><![CDATA[<p>In oracle we can use ROWID Pseudocolumn,<br />
It helps to delete records even if table not contains incremental unique id &amp; without using another temp table.</p>
<p>Is there any method in sql server to delete records in such situation without using another(temp) table?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
