| SQL Server 2005 Tutorials SQL Server 2005 Tutorials and Articles discussions |
![]() |
| LinkBack | Thread Tools | Search this Thread |
|
|||
|
Deleting duplicate rows........from the following table
Quote:
ThankYou for your reply Mr.Jagdish. The table is as follows: empno empname 10 balu 10 balu 20 ravi 30 gopi 30 gopi 30 gopi so,,,please tell me how to delete duplicate rows in sql server 2000/2005. |
|
|||
|
okay mate
Quote:
cheers mate |
|
|||
|
Hi Bobby
Below is the code for Sample procedure to eliminate duplicate rows.
Though this is a bad solution ........ It will work. I am trying to find a good solution, but it is giving some errors. So if it is very urgent ......... you can use the following code ....... CREATE PROCEDURE dbo.PROC_Eliminate_Duplicate_Rows AS SET NOCOUNT ON CREATE TABLE #TBL_Duplicate (EMPNo int, EMPName varchar(50)) INSERT INTO #TBL_Duplicate SELECT DISTINCT * FROM EMP_Duplicate DELETE EMP_Duplicate INSERT INTO EMP_Duplicate SELECT * FROM #TBL_Duplicate SELECT * FROM EMP_Duplicate RETURN Regards, Jagadish Babu Very soon I will post u a best solution. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| delete the duplicate | sandeeppradhan | SQL Server | 2 | 04-23-2008 04:23 AM |
| Eliminating Duplicate Rows from Flat File | cyrus | Data Warehousing | 2 | 08-24-2007 08:16 AM |
| Retain Duplicate | cyrus | DB2 | 1 | 03-13-2007 10:09 PM |
| How to delete duplicate rows from a table | athermaliq | Oracle Tutorials | 5 | 01-17-2006 12:03 AM |
| [FAQ] FileMaker Pro - database for Macintosh and Windows | Martin Trautmann | Tech FAQ | 0 | 04-17-2004 07:26 AM |