﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / dupliate records / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 17:42:29 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: dupliate records</title><link>http://www.sqlservercentral.com/Forums/Topic579287-338-1.aspx</link><description>[quote][b]Daryl Smith (10/1/2008)[/b][hr]if exists(SELECT material_code  FROM MATERIAL_UPDATES GROUP BY material_code HAVING count(*) &amp;gt; 1)BEGIN  select "Table has Duplicates"  RETURNENDelseselect "No Duplicates"-- your query here[/quote]little nice stuff here ...!!! :hehe:</description><pubDate>Thu, 02 Oct 2008 12:46:32 GMT</pubDate><dc:creator>Dugi</dc:creator></item><item><title>RE: dupliate records</title><link>http://www.sqlservercentral.com/Forums/Topic579287-338-1.aspx</link><description>THANKS SMITH FOR THE HELPITS WORKING FINE FOR ME ONCE AGAIN THANK YOU</description><pubDate>Thu, 02 Oct 2008 11:05:29 GMT</pubDate><dc:creator>chereku</dc:creator></item><item><title>RE: dupliate records</title><link>http://www.sqlservercentral.com/Forums/Topic579287-338-1.aspx</link><description>if exists(SELECT material_code  FROM MATERIAL_UPDATES GROUP BY material_code HAVING count(*) &amp;gt; 1)BEGIN  select "Table has Duplicates"  RETURNENDelseselect "No Duplicates"-- your query here</description><pubDate>Wed, 01 Oct 2008 17:13:48 GMT</pubDate><dc:creator>Daryl AZ</dc:creator></item><item><title>dupliate records</title><link>http://www.sqlservercentral.com/Forums/Topic579287-338-1.aspx</link><description>hi  iam having this problem with duplicate records, I want a query which will check the table for any duplicate records if there are any duplicates it should print "table has duplicates and quit the query and if there ae no duplicates it should print "no duplicates" and executethe query, i tried to use the below query but iam getting some errors could some one helpSELECT count(*) ,material_code FROM MATERIAL_UPDATES GROUP BY material_code HAVING count(*) &amp;gt; 1IF count(*) &amp;gt; 1 BEGIN[color=1001][/color]BEGINCOMMIT    PRINT ' SUCCESS - no duplicate rows'ENDELSEBEGINROLLBACK    print ' Failed - duplicate rows found'ENDCOMMIT   END</description><pubDate>Wed, 01 Oct 2008 11:57:36 GMT</pubDate><dc:creator>chereku</dc:creator></item></channel></rss>