How to remove duplicate rows from a table in SQL Server | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

How to remove duplicate rows from a table in SQL Server

Tuesday

Remove Duplicate Rows from a Table in SQL Server:
                    Duplication rows in database tables will exists by running the data repeatedly With out  having the primary key on table. Here is an example to remove the duplicate records  from a table in SQL Server

                       

DELETE FROM Employee emp1 WHERE ROW_NUMBER()<>(SELECT MIN( ROW_NUMBER())FROM       EMployee emp2 WHERE emp1.empname= emp2.empname) 

Please share this post if it's useful to you. Thanks!.

0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets